OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.53.
[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: 2013-08-15 19:32+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:27
21 #, no-wrap
22 msgid "ASPRINTF"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/asprintf.3:27 build/C/man3/fcloseall.3:25 build/C/man3/ferror.3:44 build/C/man3/fmtmsg.3:13 build/C/man3/stdio_ext.3:25 build/C/man3/tmpnam.3:27
27 #, no-wrap
28 msgid "2013-06-21"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/asprintf.3:27 build/C/man3/ctermid.3:26 build/C/man3/dprintf.3:26 build/C/man3/fclose.3:44 build/C/man3/fcloseall.3:25 build/C/man3/fflush.3:45 build/C/man3/fgetwc.3:18 build/C/man3/fmemopen.3:10 build/C/man3/fopen.3:44 build/C/man3/fputwc.3:16 build/C/man3/fread.3:45 build/C/man3/fseek.3:42 build/C/man3/getline.3:26 build/C/man3/gets.3:27 build/C/man3/getw.3:25 build/C/man3/popen.3:40 build/C/man3/printf.3:34 build/C/man3/puts.3:26 build/C/man3/remove.3:31 build/C/man3/scanf.3:52 build/C/man3/wprintf.3:16
33 #, no-wrap
34 msgid "GNU"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/asprintf.3:27 build/C/man3/ctermid.3:26 build/C/man3/dprintf.3:26 build/C/man3/fclose.3:44 build/C/man3/fcloseall.3:25 build/C/man3/ferror.3:44 build/C/man3/fflush.3:45 build/C/man3/fgetwc.3:18 build/C/man3/flockfile.3:25 build/C/man3/fmemopen.3:10 build/C/man3/fmtmsg.3:13 build/C/man3/fopen.3:44 build/C/man3/fopencookie.3:26 build/C/man3/fpurge.3:25 build/C/man3/fputwc.3:16 build/C/man3/fread.3:45 build/C/man3/fseek.3:42 build/C/man3/fseeko.3:25 build/C/man3/getline.3:26 build/C/man3/gets.3:27 build/C/man3/getw.3:25 build/C/man2/link.2:31 build/C/man2/llseek.2:28 build/C/man2/lseek.2:47 build/C/man3/lseek64.3:25 build/C/man2/open.2:51 build/C/man3/perror.3:31 build/C/man2/pipe.2:36 build/C/man3/popen.3:40 build/C/man3/printf.3:34 build/C/man3/puts.3:26 build/C/man2/read.2:35 build/C/man2/readlink.2:43 build/C/man2/readv.2:32 build/C/man3/remove.3:31 build/C/man2/rename.2:32 build/C/man2/rmdir.2:30 build/C/man3/scanf.3:52 build/C/man3/setbuf.3:48 build/C/man3/stdin.3:13 build/C/man3/stdio.3:39 build/C/man3/stdio_ext.3:25 build/C/man2/symlink.2:32 build/C/man7/symlink.7:36 build/C/man3/tempnam.3:25 build/C/man3/tmpfile.3:31 build/C/man3/tmpnam.3:27 build/C/man2/unlink.2:32 build/C/man3/unlocked_stdio.3:25 build/C/man3/wprintf.3:16 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:28 build/C/man3/ctermid.3:27 build/C/man3/dprintf.3:27 build/C/man3/fclose.3:45 build/C/man3/fcloseall.3:26 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:11 build/C/man3/fmtmsg.3:14 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:32 build/C/man2/llseek.2:29 build/C/man2/lseek.2:48 build/C/man3/lseek64.3:26 build/C/man2/open.2:52 build/C/man3/perror.3:32 build/C/man2/pipe.2:37 build/C/man3/popen.3:41 build/C/man3/printf.3:35 build/C/man3/puts.3:27 build/C/man2/read.2:36 build/C/man2/readlink.2:44 build/C/man2/readv.2:33 build/C/man3/remove.3:32 build/C/man2/rename.2:33 build/C/man2/rmdir.2:31 build/C/man3/scanf.3:53 build/C/man3/setbuf.3:49 build/C/man3/stdin.3:14 build/C/man3/stdio.3:40 build/C/man3/stdio_ext.3:26 build/C/man2/symlink.2:33 build/C/man7/symlink.7:37 build/C/man3/tempnam.3:26 build/C/man3/tmpfile.3:32 build/C/man3/tmpnam.3:28 build/C/man2/unlink.2:33 build/C/man3/unlocked_stdio.3:26 build/C/man3/wprintf.3:17 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:30
51 msgid "asprintf, vasprintf - print to allocated string"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man3/asprintf.3:30 build/C/man3/ctermid.3:29 build/C/man3/dprintf.3:29 build/C/man3/fclose.3:47 build/C/man3/fcloseall.3:28 build/C/man3/ferror.3:47 build/C/man3/fflush.3:48 build/C/man3/fgetwc.3:21 build/C/man3/flockfile.3:28 build/C/man3/fmemopen.3:13 build/C/man3/fmtmsg.3:16 build/C/man3/fopen.3:47 build/C/man3/fopencookie.3:29 build/C/man3/fpurge.3:28 build/C/man3/fputwc.3:19 build/C/man3/fread.3:48 build/C/man3/fseek.3:45 build/C/man3/fseeko.3:28 build/C/man3/getline.3:29 build/C/man3/gets.3:30 build/C/man3/getw.3:28 build/C/man2/link.2:34 build/C/man2/llseek.2:31 build/C/man2/lseek.2:50 build/C/man3/lseek64.3:28 build/C/man2/open.2:54 build/C/man3/perror.3:34 build/C/man2/pipe.2:39 build/C/man3/popen.3:43 build/C/man3/printf.3:38 build/C/man3/puts.3:29 build/C/man2/read.2:38 build/C/man2/readlink.2:46 build/C/man2/readv.2:35 build/C/man3/remove.3:34 build/C/man2/rename.2:35 build/C/man2/rmdir.2:33 build/C/man3/scanf.3:55 build/C/man3/setbuf.3:51 build/C/man3/stdin.3:16 build/C/man3/stdio.3:42 build/C/man3/stdio_ext.3:30 build/C/man2/symlink.2:35 build/C/man3/tempnam.3:28 build/C/man3/tmpfile.3:34 build/C/man3/tmpnam.3:30 build/C/man2/unlink.2:35 build/C/man3/unlocked_stdio.3:29 build/C/man3/wprintf.3:20 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:32
62 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
63 msgstr ""
64
65 #. type: Plain text
66 #: build/C/man3/asprintf.3:34 build/C/man3/dprintf.3:31 build/C/man3/fclose.3:49 build/C/man3/ferror.3:49 build/C/man3/fflush.3:50 build/C/man3/fseek.3:47 build/C/man3/perror.3:36 build/C/man3/printf.3:40 build/C/man3/remove.3:36 build/C/man2/rename.2:37 build/C/man3/stdio.3:44 build/C/man3/stdio_ext.3:32
67 msgid "B<#include E<lt>stdio.hE<gt>>"
68 msgstr ""
69
70 #. type: Plain text
71 #: build/C/man3/asprintf.3:36
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:38
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:38 build/C/man3/ctermid.3:46 build/C/man3/dprintf.3:55 build/C/man3/fclose.3:51 build/C/man3/fcloseall.3:35 build/C/man3/ferror.3:65 build/C/man3/fflush.3:52 build/C/man3/fgetwc.3:30 build/C/man3/flockfile.3:51 build/C/man3/fmemopen.3:46 build/C/man3/fmtmsg.3:26 build/C/man3/fopen.3:65 build/C/man3/fopencookie.3:37 build/C/man3/fpurge.3:42 build/C/man3/fputwc.3:28 build/C/man3/fread.3:58 build/C/man3/fseek.3:57 build/C/man3/fseeko.3:37 build/C/man3/getline.3:58 build/C/man3/gets.3:46 build/C/man3/getw.3:59 build/C/man2/link.2:38 build/C/man2/llseek.2:43 build/C/man2/lseek.2:56 build/C/man3/lseek64.3:36 build/C/man2/open.2:65 build/C/man3/perror.3:55 build/C/man2/pipe.2:51 build/C/man3/popen.3:64 build/C/man3/printf.3:76 build/C/man3/puts.3:43 build/C/man2/read.2:44 build/C/man2/readlink.2:63 build/C/man2/readv.2:58 build/C/man3/remove.3:38 build/C/man2/rename.2:39 build/C/man2/rmdir.2:37 build/C/man3/scanf.3:87 build/C/man3/setbuf.3:73 build/C/man3/stdin.3:24 build/C/man3/stdio.3:50 build/C/man3/stdio_ext.3:54 build/C/man2/symlink.2:52 build/C/man3/tempnam.3:42 build/C/man3/tmpfile.3:40 build/C/man3/tmpnam.3:36 build/C/man2/unlink.2:39 build/C/man3/unlocked_stdio.3:106 build/C/man3/wprintf.3:60 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:53
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 "
94 "(\\(aq\\e0\\(aq), and return a pointer to it via the first argument.  This "
95 "pointer should be passed to B<free>(3)  to release the allocated storage "
96 "when it is no longer needed."
97 msgstr ""
98
99 #. type: SH
100 #: build/C/man3/asprintf.3:53 build/C/man3/ctermid.3:59 build/C/man3/fclose.3:59 build/C/man3/fcloseall.3:50 build/C/man3/fflush.3:74 build/C/man3/fgetwc.3:55 build/C/man3/flockfile.3:120 build/C/man3/fmemopen.3:176 build/C/man3/fmtmsg.3:152 build/C/man3/fopen.3:189 build/C/man3/fopencookie.3:238 build/C/man3/fpurge.3:58 build/C/man3/fputwc.3:54 build/C/man3/fread.3:83 build/C/man3/fseek.3:121 build/C/man3/fseeko.3:75 build/C/man3/getline.3:110 build/C/man3/gets.3:111 build/C/man3/getw.3:73 build/C/man2/link.2:52 build/C/man2/llseek.2:62 build/C/man2/lseek.2:162 build/C/man2/open.2:567 build/C/man2/pipe.2:92 build/C/man3/popen.3:123 build/C/man3/puts.3:84 build/C/man2/read.2:81 build/C/man2/readlink.2:77 build/C/man2/readv.2:177 build/C/man3/remove.3:60 build/C/man2/rename.2:91 build/C/man2/rmdir.2:40 build/C/man3/scanf.3:530 build/C/man3/setbuf.3:152 build/C/man2/symlink.2:84 build/C/man3/tempnam.3:87 build/C/man3/tmpfile.3:47 build/C/man3/tmpnam.3:70 build/C/man2/unlink.2:55 build/C/man3/wprintf.3:205 build/C/man2/write.2:89
101 #, no-wrap
102 msgid "RETURN VALUE"
103 msgstr ""
104
105 #. type: Plain text
106 #: build/C/man3/asprintf.3:61
107 msgid ""
108 "When successful, these functions return the number of bytes printed, just "
109 "like B<sprintf>(3).  If memory allocation wasn't possible, or some other "
110 "error occurs, these functions will return -1, and the contents of I<strp> is "
111 "undefined."
112 msgstr ""
113
114 #. type: SH
115 #: build/C/man3/asprintf.3:61 build/C/man3/ctermid.3:67 build/C/man3/dprintf.3:69 build/C/man3/fclose.3:90 build/C/man3/fcloseall.3:60 build/C/man3/ferror.3:115 build/C/man3/fflush.3:98 build/C/man3/fgetwc.3:70 build/C/man3/flockfile.3:135 build/C/man3/fmemopen.3:195 build/C/man3/fmtmsg.3:237 build/C/man3/fopen.3:246 build/C/man3/fopencookie.3:245 build/C/man3/fpurge.3:70 build/C/man3/fputwc.3:68 build/C/man3/fread.3:103 build/C/man3/fseek.3:168 build/C/man3/fseeko.3:87 build/C/man3/getline.3:137 build/C/man3/gets.3:138 build/C/man3/getw.3:80 build/C/man2/link.2:138 build/C/man2/llseek.2:81 build/C/man2/lseek.2:200 build/C/man2/open.2:719 build/C/man3/perror.3:111 build/C/man2/pipe.2:118 build/C/man3/popen.3:172 build/C/man3/printf.3:806 build/C/man3/puts.3:103 build/C/man2/read.2:173 build/C/man2/readlink.2:125 build/C/man2/readv.2:214 build/C/man3/remove.3:70 build/C/man2/rename.2:232 build/C/man2/rmdir.2:127 build/C/man3/scanf.3:577 build/C/man3/setbuf.3:164 build/C/man3/stdin.3:113 build/C/man3/stdio.3:246 build/C/man2/symlink.2:149 build/C/man3/tempnam.3:98 build/C/man3/tmpfile.3:78 build/C/man3/tmpnam.3:87 build/C/man2/unlink.2:141 build/C/man3/unlocked_stdio.3:113 build/C/man3/wprintf.3:213 build/C/man2/write.2:185
116 #, no-wrap
117 msgid "CONFORMING TO"
118 msgstr ""
119
120 #. type: Plain text
121 #: build/C/man3/asprintf.3:67
122 msgid ""
123 "These functions are GNU extensions, not in C or POSIX.  They are also "
124 "available under *BSD.  The FreeBSD implementation sets I<strp> to NULL on "
125 "error."
126 msgstr ""
127
128 #. type: SH
129 #: build/C/man3/asprintf.3:67 build/C/man3/ctermid.3:77 build/C/man3/dprintf.3:95 build/C/man3/fclose.3:102 build/C/man3/fcloseall.3:62 build/C/man3/ferror.3:122 build/C/man3/fflush.3:113 build/C/man3/fgetwc.3:87 build/C/man3/flockfile.3:143 build/C/man3/fmemopen.3:341 build/C/man3/fmtmsg.3:309 build/C/man3/fopen.3:348 build/C/man3/fopencookie.3:437 build/C/man3/fpurge.3:80 build/C/man3/fputwc.3:85 build/C/man3/fread.3:105 build/C/man3/fseek.3:170 build/C/man3/fseeko.3:93 build/C/man3/getline.3:171 build/C/man3/gets.3:173 build/C/man3/getw.3:86 build/C/man2/link.2:187 build/C/man2/llseek.2:87 build/C/man2/lseek.2:245 build/C/man3/lseek64.3:159 build/C/man2/open.2:992 build/C/man3/perror.3:139 build/C/man2/pipe.2:190 build/C/man3/popen.3:201 build/C/man3/printf.3:1080 build/C/man3/puts.3:112 build/C/man2/read.2:187 build/C/man2/readlink.2:214 build/C/man2/readv.2:284 build/C/man3/remove.3:81 build/C/man2/rename.2:245 build/C/man2/rmdir.2:132 build/C/man3/scanf.3:715 build/C/man3/setbuf.3:200 build/C/man3/stdin.3:154 build/C/man3/stdio.3:250 build/C/man3/stdio_ext.3:151 build/C/man2/symlink.2:164 build/C/man7/symlink.7:471 build/C/man3/tempnam.3:168 build/C/man3/tmpfile.3:97 build/C/man3/tmpnam.3:163 build/C/man2/unlink.2:148 build/C/man3/unlocked_stdio.3:136 build/C/man3/wprintf.3:253 build/C/man2/write.2:211
130 #, no-wrap
131 msgid "SEE ALSO"
132 msgstr ""
133
134 #. type: Plain text
135 #: build/C/man3/asprintf.3:71
136 msgid "B<free>(3), B<malloc>(3), B<printf>(3)"
137 msgstr ""
138
139 #. type: SH
140 #: build/C/man3/asprintf.3:71 build/C/man3/ctermid.3:79 build/C/man3/dprintf.3:97 build/C/man3/fclose.3:108 build/C/man3/fcloseall.3:68 build/C/man3/ferror.3:127 build/C/man3/fflush.3:121 build/C/man3/fgetwc.3:92 build/C/man3/flockfile.3:145 build/C/man3/fmemopen.3:344 build/C/man3/fmtmsg.3:312 build/C/man3/fopen.3:354 build/C/man3/fopencookie.3:442 build/C/man3/fpurge.3:85 build/C/man3/fputwc.3:89 build/C/man3/fread.3:111 build/C/man3/fseek.3:173 build/C/man3/fseeko.3:95 build/C/man3/getline.3:178 build/C/man3/gets.3:189 build/C/man3/getw.3:92 build/C/man2/link.2:197 build/C/man2/llseek.2:90 build/C/man2/lseek.2:252 build/C/man3/lseek64.3:162 build/C/man2/open.2:1014 build/C/man3/perror.3:144 build/C/man2/pipe.2:197 build/C/man3/popen.3:211 build/C/man3/printf.3:1089 build/C/man3/puts.3:124 build/C/man2/read.2:200 build/C/man2/readlink.2:222 build/C/man2/readv.2:288 build/C/man3/remove.3:92 build/C/man2/rename.2:254 build/C/man2/rmdir.2:141 build/C/man3/scanf.3:722 build/C/man3/setbuf.3:208 build/C/man3/stdin.3:160 build/C/man3/stdio.3:257 build/C/man3/stdio_ext.3:154 build/C/man2/symlink.2:176 build/C/man7/symlink.7:489 build/C/man3/tempnam.3:173 build/C/man3/tmpfile.3:103 build/C/man3/tmpnam.3:168 build/C/man2/unlink.2:161 build/C/man3/unlocked_stdio.3:139 build/C/man3/wprintf.3:260 build/C/man2/write.2:223
141 #, no-wrap
142 msgid "COLOPHON"
143 msgstr ""
144
145 #. type: Plain text
146 #: build/C/man3/asprintf.3:78 build/C/man3/ctermid.3:86 build/C/man3/dprintf.3:104 build/C/man3/fclose.3:115 build/C/man3/fcloseall.3:75 build/C/man3/ferror.3:134 build/C/man3/fflush.3:128 build/C/man3/fgetwc.3:99 build/C/man3/flockfile.3:152 build/C/man3/fmemopen.3:351 build/C/man3/fmtmsg.3:319 build/C/man3/fopen.3:361 build/C/man3/fopencookie.3:449 build/C/man3/fpurge.3:92 build/C/man3/fputwc.3:96 build/C/man3/fread.3:118 build/C/man3/fseek.3:180 build/C/man3/fseeko.3:102 build/C/man3/getline.3:185 build/C/man3/gets.3:196 build/C/man3/getw.3:99 build/C/man2/link.2:204 build/C/man2/llseek.2:97 build/C/man2/lseek.2:259 build/C/man3/lseek64.3:169 build/C/man2/open.2:1021 build/C/man3/perror.3:151 build/C/man2/pipe.2:204 build/C/man3/popen.3:218 build/C/man3/printf.3:1096 build/C/man3/puts.3:131 build/C/man2/read.2:207 build/C/man2/readlink.2:229 build/C/man2/readv.2:295 build/C/man3/remove.3:99 build/C/man2/rename.2:261 build/C/man2/rmdir.2:148 build/C/man3/scanf.3:729 build/C/man3/setbuf.3:215 build/C/man3/stdin.3:167 build/C/man3/stdio.3:264 build/C/man3/stdio_ext.3:161 build/C/man2/symlink.2:183 build/C/man7/symlink.7:496 build/C/man3/tempnam.3:180 build/C/man3/tmpfile.3:110 build/C/man3/tmpnam.3:175 build/C/man2/unlink.2:168 build/C/man3/unlocked_stdio.3:146 build/C/man3/wprintf.3:267 build/C/man2/write.2:230
147 msgid ""
148 "This page is part of release 3.53 of the Linux I<man-pages> project.  A "
149 "description of the project, and information about reporting bugs, can be "
150 "found at \\%http://www.kernel.org/doc/man-pages/."
151 msgstr ""
152
153 #. type: TH
154 #: build/C/man3/ctermid.3:26
155 #, no-wrap
156 msgid "CTERMID"
157 msgstr ""
158
159 #. type: TH
160 #: build/C/man3/ctermid.3:26
161 #, no-wrap
162 msgid "2013-07-04"
163 msgstr ""
164
165 #. type: Plain text
166 #: build/C/man3/ctermid.3:29
167 msgid "ctermid - get controlling terminal name"
168 msgstr ""
169
170 #. type: Plain text
171 #: build/C/man3/ctermid.3:34 build/C/man3/fgetwc.3:24 build/C/man3/flockfile.3:31 build/C/man3/fmemopen.3:16 build/C/man3/fopen.3:50 build/C/man3/fputwc.3:22 build/C/man3/fread.3:51 build/C/man3/fseeko.3:31 build/C/man3/getline.3:32 build/C/man3/gets.3:33 build/C/man3/getw.3:31 build/C/man3/popen.3:46 build/C/man3/puts.3:32 build/C/man3/scanf.3:58 build/C/man3/setbuf.3:54 build/C/man3/stdin.3:19 build/C/man3/tempnam.3:31 build/C/man3/tmpfile.3:37 build/C/man3/tmpnam.3:33 build/C/man3/unlocked_stdio.3:32
172 #, no-wrap
173 msgid "B<#include E<lt>stdio.hE<gt>>\n"
174 msgstr ""
175
176 #. type: Plain text
177 #: build/C/man3/ctermid.3:36
178 #, no-wrap
179 msgid "B<char *ctermid(char *>I<s>B<);>\n"
180 msgstr ""
181
182 #. type: Plain text
183 #: build/C/man3/ctermid.3:41 build/C/man3/dprintf.3:39 build/C/man3/ferror.3:61 build/C/man3/flockfile.3:42 build/C/man3/fmemopen.3:29 build/C/man3/fopen.3:61 build/C/man3/getline.3:42 build/C/man3/getw.3:40 build/C/man3/perror.3:50 build/C/man3/popen.3:55 build/C/man3/printf.3:63 build/C/man2/readlink.2:54 build/C/man2/readv.2:53 build/C/man3/scanf.3:73 build/C/man3/setbuf.3:68 build/C/man2/symlink.2:43 build/C/man3/tempnam.3:38 build/C/man3/unlocked_stdio.3:68 build/C/man3/wprintf.3:39
184 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
185 msgstr ""
186
187 #.  From <unistd.h>: _XOPEN_SOURCE
188 #. type: Plain text
189 #: build/C/man3/ctermid.3:46
190 msgid "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
191 msgstr ""
192
193 #. type: Plain text
194 #: build/C/man3/ctermid.3:59
195 msgid ""
196 "B<ctermid>()  returns a string which is the pathname for the current "
197 "controlling terminal for this process.  If I<s> is NULL, a static buffer is "
198 "used, otherwise I<s> points to a buffer used to hold the terminal pathname.  "
199 "The symbolic constant B<L_ctermid> is the maximum number of characters in "
200 "the returned pathname."
201 msgstr ""
202
203 #. type: Plain text
204 #: build/C/man3/ctermid.3:61
205 msgid "The pointer to the pathname."
206 msgstr ""
207
208 #. type: SH
209 #: build/C/man3/ctermid.3:61 build/C/man3/fcloseall.3:55 build/C/man3/ferror.3:106 build/C/man3/fflush.3:93 build/C/man3/flockfile.3:127 build/C/man3/fmtmsg.3:225 build/C/man3/stdio_ext.3:132 build/C/man3/tmpnam.3:77
210 #, no-wrap
211 msgid "ATTRIBUTES"
212 msgstr ""
213
214 #. type: SS
215 #: build/C/man3/ctermid.3:62 build/C/man3/fcloseall.3:56 build/C/man3/ferror.3:107 build/C/man3/fflush.3:94 build/C/man3/flockfile.3:128 build/C/man3/fmtmsg.3:226 build/C/man3/stdio_ext.3:133 build/C/man3/tmpnam.3:78
216 #, no-wrap
217 msgid "Multithreading (see pthreads(7))"
218 msgstr ""
219
220 #. type: Plain text
221 #: build/C/man3/ctermid.3:67
222 msgid ""
223 "The B<ctermid>()  function is thread-safe with exceptions.  It is not "
224 "thread-safe if called with a NULL parameter."
225 msgstr ""
226
227 #. type: Plain text
228 #: build/C/man3/ctermid.3:69
229 msgid "Svr4, POSIX.1-2001."
230 msgstr ""
231
232 #. type: SH
233 #: build/C/man3/ctermid.3:69 build/C/man3/fmemopen.3:213 build/C/man3/fopen.3:331 build/C/man3/gets.3:152 build/C/man3/getw.3:82 build/C/man2/link.2:181 build/C/man2/open.2:981 build/C/man3/popen.3:178 build/C/man3/printf.3:929 build/C/man3/puts.3:105 build/C/man2/readv.2:258 build/C/man3/remove.3:78 build/C/man2/rename.2:234 build/C/man2/rmdir.2:129 build/C/man3/scanf.3:646 build/C/man3/setbuf.3:170 build/C/man3/tempnam.3:158 build/C/man3/tmpnam.3:156 build/C/man2/unlink.2:145
234 #, no-wrap
235 msgid "BUGS"
236 msgstr ""
237
238 #. type: Plain text
239 #: build/C/man3/ctermid.3:73
240 msgid ""
241 "The path returned may not uniquely identify the controlling terminal; it "
242 "may, for example, be I</dev/tty>."
243 msgstr ""
244
245 #.  in glibc 2.3.x, x >= 4, the glibc headers threw an error
246 #.  if ctermid() was given an argument; fixed in 2.4.
247 #. type: Plain text
248 #: build/C/man3/ctermid.3:77
249 msgid "It is not assured that the program can open the terminal."
250 msgstr ""
251
252 #. type: Plain text
253 #: build/C/man3/ctermid.3:79
254 msgid "B<ttyname>(3)"
255 msgstr ""
256
257 #. type: TH
258 #: build/C/man3/dprintf.3:26
259 #, no-wrap
260 msgid "DPRINTF"
261 msgstr ""
262
263 #. type: TH
264 #: build/C/man3/dprintf.3:26
265 #, no-wrap
266 msgid "2010-09-15"
267 msgstr ""
268
269 #. type: Plain text
270 #: build/C/man3/dprintf.3:29
271 msgid "dprintf, vdprintf - print to a file descriptor"
272 msgstr ""
273
274 #. type: Plain text
275 #: build/C/man3/dprintf.3:33
276 msgid "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
277 msgstr ""
278
279 #. type: Plain text
280 #: build/C/man3/dprintf.3:35
281 msgid "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
282 msgstr ""
283
284 #. type: Plain text
285 #: build/C/man3/dprintf.3:43
286 msgid "B<dprintf>(), B<vdprintf>():"
287 msgstr ""
288
289 #. type: TP
290 #: build/C/man3/dprintf.3:46 build/C/man3/fmemopen.3:37 build/C/man3/getline.3:49
291 #, no-wrap
292 msgid "Since glibc 2.10:"
293 msgstr ""
294
295 #. type: Plain text
296 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40
297 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
298 msgstr ""
299
300 #. type: TP
301 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40 build/C/man3/getline.3:52
302 #, no-wrap
303 msgid "Before glibc 2.10:"
304 msgstr ""
305
306 #. type: Plain text
307 #: build/C/man3/dprintf.3:52 build/C/man3/fmemopen.3:43 build/C/man3/getline.3:55 build/C/man3/unlocked_stdio.3:104
308 msgid "_GNU_SOURCE"
309 msgstr ""
310
311 #. type: Plain text
312 #: build/C/man3/dprintf.3:69
313 msgid ""
314 "The functions B<dprintf>()  and B<vdprintf>()  (as found in the glibc2 "
315 "library) are exact analogs of B<fprintf>(3)  and B<vfprintf>(3), except that "
316 "they output to a file descriptor I<fd> instead of to a I<stdio> stream."
317 msgstr ""
318
319 #.  .SH NOTES
320 #.  These functions are GNU extensions, not in C or POSIX.
321 #.  Clearly, the names were badly chosen.
322 #.  Many systems (like MacOS) have incompatible functions called
323 #.  .BR dprintf (),
324 #.  usually some debugging version of
325 #.  .BR printf (3),
326 #.  perhaps with a prototype like
327 #
328 #.  .BI "void dprintf(int level, const char *" format ", ...);"
329 #
330 #.  where the first argument is a debugging level (and output is to
331 #.  .IR stderr ).
332 #.  Moreover,
333 #.  .BR dprintf ()
334 #.  (or
335 #.  .BR DPRINTF )
336 #.  is also a popular macro name for a debugging printf.
337 #.  So, probably, it is better to avoid this function in programs
338 #.  intended to be portable.
339 #
340 #.  A better name would have been
341 #.  .BR fdprintf ().
342 #. type: Plain text
343 #: build/C/man3/dprintf.3:95
344 msgid ""
345 "These functions are GNU extensions that are nowadays specified in "
346 "POSIX.1-2008."
347 msgstr ""
348
349 #. type: Plain text
350 #: build/C/man3/dprintf.3:97
351 msgid "B<printf>(3)"
352 msgstr ""
353
354 #. type: TH
355 #: build/C/man3/fclose.3:44
356 #, no-wrap
357 msgid "FCLOSE"
358 msgstr ""
359
360 #. type: TH
361 #: build/C/man3/fclose.3:44
362 #, no-wrap
363 msgid "2009-02-23"
364 msgstr ""
365
366 #. type: Plain text
367 #: build/C/man3/fclose.3:47
368 msgid "fclose - close a stream"
369 msgstr ""
370
371 #. type: Plain text
372 #: build/C/man3/fclose.3:51
373 msgid "B<int fclose(FILE *>I<fp>B<);>"
374 msgstr ""
375
376 #. type: Plain text
377 #: build/C/man3/fclose.3:59
378 msgid ""
379 "The B<fclose>()  function flushes the stream pointed to by I<fp> (writing "
380 "any buffered output data using B<fflush>(3))  and closes the underlying file "
381 "descriptor."
382 msgstr ""
383
384 #. type: Plain text
385 #: build/C/man3/fclose.3:70
386 msgid ""
387 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
388 "I<errno> is set to indicate the error.  In either case any further access "
389 "(including another call to B<fclose>())  to the stream results in undefined "
390 "behavior."
391 msgstr ""
392
393 #. type: SH
394 #: build/C/man3/fclose.3:70 build/C/man3/ferror.3:96 build/C/man3/fflush.3:81 build/C/man3/fgetwc.3:64 build/C/man3/flockfile.3:125 build/C/man3/fopen.3:201 build/C/man3/fpurge.3:65 build/C/man3/fputwc.3:63 build/C/man3/fseek.3:136 build/C/man3/fseeko.3:84 build/C/man3/getline.3:125 build/C/man2/link.2:57 build/C/man2/llseek.2:69 build/C/man2/lseek.2:170 build/C/man2/open.2:575 build/C/man2/pipe.2:97 build/C/man3/popen.3:146 build/C/man2/read.2:95 build/C/man2/readlink.2:85 build/C/man2/readv.2:188 build/C/man3/remove.3:65 build/C/man2/rename.2:96 build/C/man2/rmdir.2:45 build/C/man3/scanf.3:547 build/C/man2/symlink.2:89 build/C/man3/tempnam.3:94 build/C/man3/tmpfile.3:56 build/C/man3/tmpnam.3:75 build/C/man2/unlink.2:60 build/C/man2/write.2:107
395 #, no-wrap
396 msgid "ERRORS"
397 msgstr ""
398
399 #. type: TP
400 #: build/C/man3/fclose.3:71 build/C/man3/fflush.3:82 build/C/man3/fpurge.3:66 build/C/man3/fseek.3:137 build/C/man2/llseek.2:70 build/C/man2/lseek.2:171 build/C/man2/read.2:114 build/C/man3/scanf.3:553 build/C/man2/write.2:126
401 #, no-wrap
402 msgid "B<EBADF>"
403 msgstr ""
404
405 #.   This error cannot occur unless you are mixing ANSI C stdio operations and
406 #.   low-level file operations on the same stream. If you do get this error,
407 #.   you must have closed the stream's low-level file descriptor using
408 #.   something like close(fileno(fp)).
409 #. type: Plain text
410 #: build/C/man3/fclose.3:80
411 msgid "The file descriptor underlying I<fp> is not valid."
412 msgstr ""
413
414 #. type: Plain text
415 #: build/C/man3/fclose.3:90
416 msgid ""
417 "The B<fclose>()  function may also fail and set I<errno> for any of the "
418 "errors specified for the routines B<close>(2), B<write>(2)  or B<fflush>(3)."
419 msgstr ""
420
421 #. type: Plain text
422 #: build/C/man3/fclose.3:92 build/C/man3/fseek.3:170 build/C/man3/puts.3:105
423 msgid "C89, C99."
424 msgstr ""
425
426 #. type: SH
427 #: build/C/man3/fclose.3:92 build/C/man3/fflush.3:104 build/C/man3/fgetwc.3:72 build/C/man3/fmemopen.3:207 build/C/man3/fmtmsg.3:252 build/C/man3/fopen.3:255 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:70 build/C/man3/fseeko.3:89 build/C/man2/link.2:143 build/C/man2/llseek.2:84 build/C/man2/lseek.2:210 build/C/man2/open.2:746 build/C/man3/perror.3:124 build/C/man3/printf.3:867 build/C/man2/read.2:175 build/C/man2/readlink.2:130 build/C/man2/readv.2:226 build/C/man3/remove.3:72 build/C/man3/scanf.3:608 build/C/man3/stdin.3:122 build/C/man2/symlink.2:155 build/C/man3/tempnam.3:103 build/C/man3/tmpfile.3:80 build/C/man3/tmpnam.3:92 build/C/man3/wprintf.3:215 build/C/man2/write.2:194
428 #, no-wrap
429 msgid "NOTES"
430 msgstr ""
431
432 #. type: Plain text
433 #: build/C/man3/fclose.3:102
434 msgid ""
435 "Note that B<fclose>()  only flushes the user-space buffers provided by the C "
436 "library.  To ensure that the data is physically stored on disk the kernel "
437 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
438 msgstr ""
439
440 #. type: Plain text
441 #: build/C/man3/fclose.3:108
442 msgid "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
443 msgstr ""
444
445 #. type: TH
446 #: build/C/man3/fcloseall.3:25
447 #, no-wrap
448 msgid "FCLOSEALL"
449 msgstr ""
450
451 #. type: Plain text
452 #: build/C/man3/fcloseall.3:28
453 msgid "fcloseall - close all open streams"
454 msgstr ""
455
456 #. type: Plain text
457 #: build/C/man3/fcloseall.3:32 build/C/man3/fopencookie.3:33
458 #, no-wrap
459 msgid ""
460 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
461 "B<#include E<lt>stdio.hE<gt>>\n"
462 msgstr ""
463
464 #. type: Plain text
465 #: build/C/man3/fcloseall.3:34
466 #, no-wrap
467 msgid "B<int fcloseall(void);>\n"
468 msgstr ""
469
470 #. type: Plain text
471 #: build/C/man3/fcloseall.3:43
472 msgid ""
473 "The B<fcloseall>()  function closes all of the calling process's open "
474 "streams.  Buffered output for each stream is written before it is closed (as "
475 "for B<fflush>(3)); buffered input is discarded."
476 msgstr ""
477
478 #. type: Plain text
479 #: build/C/man3/fcloseall.3:50
480 msgid "The standard streams, I<stdin>, I<stdout>, and I<stderr> are also closed."
481 msgstr ""
482
483 #. type: Plain text
484 #: build/C/man3/fcloseall.3:55
485 msgid ""
486 "This function returns 0 if all files were successfully closed; on error, "
487 "B<EOF> is returned."
488 msgstr ""
489
490 #. type: Plain text
491 #: build/C/man3/fcloseall.3:60
492 msgid ""
493 "The B<fcloseall>()  function does not lock the streams, so it is not "
494 "thread-safe."
495 msgstr ""
496
497 #. type: Plain text
498 #: build/C/man3/fcloseall.3:62
499 msgid "This function is a GNU extension."
500 msgstr ""
501
502 #. type: Plain text
503 #: build/C/man3/fcloseall.3:68
504 msgid "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
505 msgstr ""
506
507 #. type: TH
508 #: build/C/man3/ferror.3:44
509 #, no-wrap
510 msgid "FERROR"
511 msgstr ""
512
513 #. type: Plain text
514 #: build/C/man3/ferror.3:47
515 msgid "clearerr, feof, ferror, fileno - check and reset stream status"
516 msgstr ""
517
518 #. type: Plain text
519 #: build/C/man3/ferror.3:51
520 msgid "B<void clearerr(FILE *>I<stream>B<);>"
521 msgstr ""
522
523 #. type: Plain text
524 #: build/C/man3/ferror.3:53
525 msgid "B<int feof(FILE *>I<stream>B<);>"
526 msgstr ""
527
528 #. type: Plain text
529 #: build/C/man3/ferror.3:55
530 msgid "B<int ferror(FILE *>I<stream>B<);>"
531 msgstr ""
532
533 #. type: Plain text
534 #: build/C/man3/ferror.3:57
535 msgid "B<int fileno(FILE *>I<stream>B<);>"
536 msgstr ""
537
538 #. type: Plain text
539 #: build/C/man3/ferror.3:65
540 msgid "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
541 msgstr ""
542
543 #. type: Plain text
544 #: build/C/man3/ferror.3:70
545 msgid ""
546 "The function B<clearerr>()  clears the end-of-file and error indicators for "
547 "the stream pointed to by I<stream>."
548 msgstr ""
549
550 #. type: Plain text
551 #: build/C/man3/ferror.3:78
552 msgid ""
553 "The function B<feof>()  tests the end-of-file indicator for the stream "
554 "pointed to by I<stream>, returning nonzero if it is set.  The end-of-file "
555 "indicator can be cleared only by the function B<clearerr>()."
556 msgstr ""
557
558 #. type: Plain text
559 #: build/C/man3/ferror.3:87
560 msgid ""
561 "The function B<ferror>()  tests the error indicator for the stream pointed "
562 "to by I<stream>, returning nonzero if it is set.  The error indicator can be "
563 "reset only by the B<clearerr>()  function."
564 msgstr ""
565
566 #. type: Plain text
567 #: build/C/man3/ferror.3:93
568 msgid ""
569 "The function B<fileno>()  examines the argument I<stream> and returns its "
570 "integer descriptor."
571 msgstr ""
572
573 #. type: Plain text
574 #: build/C/man3/ferror.3:96 build/C/man3/fgetwc.3:55 build/C/man3/fputwc.3:54 build/C/man3/fread.3:83 build/C/man3/gets.3:111 build/C/man3/puts.3:84
575 msgid "For nonlocking counterparts, see B<unlocked_stdio>(3)."
576 msgstr ""
577
578 #. type: Plain text
579 #: build/C/man3/ferror.3:106
580 msgid ""
581 "These functions should not fail and do not set the external variable "
582 "I<errno>.  (However, in case B<fileno>()  detects that its argument is not a "
583 "valid stream, it must return -1 and set I<errno> to B<EBADF>.)"
584 msgstr ""
585
586 #. type: Plain text
587 #: build/C/man3/ferror.3:115
588 msgid ""
589 "The B<clearerr>(), B<feof>(), B<ferror>(), and B<fileno>()  functions are "
590 "thread-safe."
591 msgstr ""
592
593 #. type: Plain text
594 #: build/C/man3/ferror.3:122
595 msgid ""
596 "The functions B<clearerr>(), B<feof>(), and B<ferror>()  conform to C89 and "
597 "C99."
598 msgstr ""
599
600 #. type: Plain text
601 #: build/C/man3/ferror.3:127
602 msgid "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
603 msgstr ""
604
605 #. type: TH
606 #: build/C/man3/fflush.3:45
607 #, no-wrap
608 msgid "FFLUSH"
609 msgstr ""
610
611 #. type: TH
612 #: build/C/man3/fflush.3:45
613 #, no-wrap
614 msgid "2013-07-15"
615 msgstr ""
616
617 #. type: Plain text
618 #: build/C/man3/fflush.3:48
619 msgid "fflush - flush a stream"
620 msgstr ""
621
622 #. type: Plain text
623 #: build/C/man3/fflush.3:52
624 msgid "B<int fflush(FILE *>I<stream>B<);>"
625 msgstr ""
626
627 #. type: Plain text
628 #: build/C/man3/fflush.3:63
629 msgid ""
630 "For output streams, B<fflush>()  forces a write of all user-space buffered "
631 "data for the given output or update I<stream> via the stream's underlying "
632 "write function.  For input streams, B<fflush>()  discards any buffered data "
633 "that has been fetched from the underlying file, but has not been consumed by "
634 "the application.  The open status of the stream is unaffected."
635 msgstr ""
636
637 #. type: Plain text
638 #: build/C/man3/fflush.3:71
639 msgid ""
640 "If the I<stream> argument is NULL, B<fflush>()  flushes I<all> open output "
641 "streams."
642 msgstr ""
643
644 #. type: Plain text
645 #: build/C/man3/fflush.3:74
646 msgid "For a nonlocking counterpart, see B<unlocked_stdio>(3)."
647 msgstr ""
648
649 #. type: Plain text
650 #: build/C/man3/fflush.3:81
651 msgid ""
652 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
653 "I<errno> is set to indicate the error."
654 msgstr ""
655
656 #. type: Plain text
657 #: build/C/man3/fflush.3:86
658 msgid "I<Stream> is not an open stream, or is not open for writing."
659 msgstr ""
660
661 #. type: Plain text
662 #: build/C/man3/fflush.3:93
663 msgid ""
664 "The function B<fflush>()  may also fail and set I<errno> for any of the "
665 "errors specified for B<write>(2)."
666 msgstr ""
667
668 #. type: Plain text
669 #: build/C/man3/fflush.3:98
670 msgid "The B<fflush>()  function is thread-safe."
671 msgstr ""
672
673 #. type: Plain text
674 #: build/C/man3/fflush.3:100
675 msgid "C89, C99, POSIX.1-2001, POSIX.1-2008."
676 msgstr ""
677
678 #.  Verified on: Solaris 8.
679 #. type: Plain text
680 #: build/C/man3/fflush.3:104
681 msgid ""
682 "The standards do not specify the behavior for input streams.  Most other "
683 "implementations behave the same as Linux."
684 msgstr ""
685
686 #. type: Plain text
687 #: build/C/man3/fflush.3:113
688 msgid ""
689 "Note that B<fflush>()  only flushes the user-space buffers provided by the C "
690 "library.  To ensure that the data is physically stored on disk the kernel "
691 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
692 msgstr ""
693
694 #. type: Plain text
695 #: build/C/man3/fflush.3:121
696 msgid ""
697 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
698 "B<setbuf>(3), B<unlocked_stdio>(3)"
699 msgstr ""
700
701 #. type: TH
702 #: build/C/man3/fgetwc.3:18
703 #, no-wrap
704 msgid "FGETWC"
705 msgstr ""
706
707 #. type: TH
708 #: build/C/man3/fgetwc.3:18 build/C/man3/fputwc.3:16 build/C/man3/getline.3:26 build/C/man3/popen.3:40 build/C/man3/tempnam.3:25
709 #, no-wrap
710 msgid "2013-04-19"
711 msgstr ""
712
713 #. type: Plain text
714 #: build/C/man3/fgetwc.3:21
715 msgid "fgetwc, getwc - read a wide character from a FILE stream"
716 msgstr ""
717
718 #. type: Plain text
719 #: build/C/man3/fgetwc.3:26 build/C/man3/fmemopen.3:22 build/C/man3/fputwc.3:24 build/C/man3/unlocked_stdio.3:54
720 #, no-wrap
721 msgid "B<#include E<lt>wchar.hE<gt>>\n"
722 msgstr ""
723
724 #. type: Plain text
725 #: build/C/man3/fgetwc.3:29
726 #, no-wrap
727 msgid ""
728 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
729 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
730 msgstr ""
731
732 #. type: Plain text
733 #: build/C/man3/fgetwc.3:44
734 msgid ""
735 "The B<fgetwc>()  function is the wide-character equivalent of the "
736 "B<fgetc>(3)  function.  It reads a wide character from I<stream> and returns "
737 "it.  If the end of stream is reached, or if I<ferror(stream)> becomes true, "
738 "it returns B<WEOF>.  If a wide-character conversion error occurs, it sets "
739 "I<errno> to B<EILSEQ> and returns B<WEOF>."
740 msgstr ""
741
742 #. type: Plain text
743 #: build/C/man3/fgetwc.3:52
744 msgid ""
745 "The B<getwc>()  function or macro functions identically to B<fgetwc>().  It "
746 "may be implemented as a macro, and may evaluate its argument more than "
747 "once.  There is no reason ever to use it."
748 msgstr ""
749
750 #. type: Plain text
751 #: build/C/man3/fgetwc.3:64
752 msgid ""
753 "The B<fgetwc>()  function returns the next wide-character from the stream, "
754 "or B<WEOF>.  In the event of an error, I<errno> is set to indicate the "
755 "cause."
756 msgstr ""
757
758 #. type: Plain text
759 #: build/C/man3/fgetwc.3:66 build/C/man3/fputwc.3:65
760 msgid "Apart from the usual ones, there is"
761 msgstr ""
762
763 #. type: TP
764 #: build/C/man3/fgetwc.3:66 build/C/man3/fputwc.3:65 build/C/man3/scanf.3:558
765 #, no-wrap
766 msgid "B<EILSEQ>"
767 msgstr ""
768
769 #. type: Plain text
770 #: build/C/man3/fgetwc.3:70
771 msgid "The data obtained from the input stream does not form a valid character."
772 msgstr ""
773
774 #. type: Plain text
775 #: build/C/man3/fgetwc.3:72 build/C/man3/fputwc.3:70
776 msgid "C99, POSIX.1-2001."
777 msgstr ""
778
779 #. type: Plain text
780 #: build/C/man3/fgetwc.3:79
781 msgid ""
782 "The behavior of B<fgetwc>()  depends on the B<LC_CTYPE> category of the "
783 "current locale."
784 msgstr ""
785
786 #. type: Plain text
787 #: build/C/man3/fgetwc.3:87
788 msgid ""
789 "In the absence of additional information passed to the B<fopen>(3)  call, it "
790 "is reasonable to expect that B<fgetwc>()  will actually read a multibyte "
791 "sequence from the stream and then convert it to a wide character."
792 msgstr ""
793
794 #. type: Plain text
795 #: build/C/man3/fgetwc.3:92
796 msgid "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
797 msgstr ""
798
799 #. type: TH
800 #: build/C/man3/flockfile.3:25
801 #, no-wrap
802 msgid "FLOCKFILE"
803 msgstr ""
804
805 #. type: TH
806 #: build/C/man3/flockfile.3:25
807 #, no-wrap
808 msgid "2013-07-23"
809 msgstr ""
810
811 #. type: Plain text
812 #: build/C/man3/flockfile.3:28
813 msgid "flockfile, ftrylockfile, funlockfile - lock FILE for stdio"
814 msgstr ""
815
816 #. type: Plain text
817 #: build/C/man3/flockfile.3:33
818 #, no-wrap
819 msgid "B<void flockfile(FILE *>I<filehandle>B<);>\n"
820 msgstr ""
821
822 #. type: Plain text
823 #: build/C/man3/flockfile.3:35
824 #, no-wrap
825 msgid "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
826 msgstr ""
827
828 #. type: Plain text
829 #: build/C/man3/flockfile.3:37
830 #, no-wrap
831 msgid "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
832 msgstr ""
833
834 #. type: Plain text
835 #: build/C/man3/flockfile.3:46 build/C/man3/wprintf.3:43
836 msgid "All functions shown above:"
837 msgstr ""
838
839 #. type: Plain text
840 #: build/C/man3/flockfile.3:49
841 msgid ""
842 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
843 "|| _POSIX_SOURCE"
844 msgstr ""
845
846 #. type: Plain text
847 #: build/C/man3/flockfile.3:63
848 msgid ""
849 "The stdio functions are thread-safe.  This is achieved by assigning to each "
850 "I<FILE> object a lockcount and (if the lockcount is nonzero)  an owning "
851 "thread.  For each library call, these functions wait until the I<FILE> "
852 "object is no longer locked by a different thread, then lock it, do the "
853 "requested I/O, and unlock the object again."
854 msgstr ""
855
856 #. type: Plain text
857 #: build/C/man3/flockfile.3:69
858 msgid ""
859 "(Note: this locking has nothing to do with the file locking done by "
860 "functions like B<flock>(2)  and B<lockf>(3).)"
861 msgstr ""
862
863 #. type: Plain text
864 #: build/C/man3/flockfile.3:77
865 msgid ""
866 "All this is invisible to the C-programmer, but there may be two reasons to "
867 "wish for more detailed control.  On the one hand, maybe a series of I/O "
868 "actions by one thread belongs together, and should not be interrupted by the "
869 "I/O of some other thread.  On the other hand, maybe the locking overhead "
870 "should be avoided for greater efficiency."
871 msgstr ""
872
873 #. type: Plain text
874 #: build/C/man3/flockfile.3:94
875 msgid ""
876 "To this end, a thread can explicitly lock the I<FILE> object, then do its "
877 "series of I/O actions, then unlock.  This prevents other threads from coming "
878 "in between.  If the reason for doing this was to achieve greater efficiency, "
879 "one does the I/O with the nonlocking versions of the stdio functions: with "
880 "B<getc_unlocked>(3)  and B<putc_unlocked>(3)  instead of B<getc>(3)  and "
881 "B<putc>(3)."
882 msgstr ""
883
884 #. type: Plain text
885 #: build/C/man3/flockfile.3:105
886 msgid ""
887 "The B<flockfile>()  function waits for I<*filehandle> to be no longer locked "
888 "by a different thread, then makes the current thread owner of "
889 "I<*filehandle>, and increments the lockcount."
890 msgstr ""
891
892 #. type: Plain text
893 #: build/C/man3/flockfile.3:109
894 msgid "The B<funlockfile>()  function decrements the lock count."
895 msgstr ""
896
897 #. type: Plain text
898 #: build/C/man3/flockfile.3:120
899 msgid ""
900 "The B<ftrylockfile>()  function is a nonblocking version of B<flockfile>().  "
901 "It does nothing in case some other thread owns I<*filehandle>, and it "
902 "obtains ownership and increments the lockcount otherwise."
903 msgstr ""
904
905 #. type: Plain text
906 #: build/C/man3/flockfile.3:125
907 msgid ""
908 "The B<ftrylockfile>()  function returns zero for success (the lock was "
909 "obtained), and nonzero for failure."
910 msgstr ""
911
912 #. type: Plain text
913 #: build/C/man3/flockfile.3:127
914 msgid "None."
915 msgstr ""
916
917 #. type: Plain text
918 #: build/C/man3/flockfile.3:135
919 msgid ""
920 "The B<flockfile>(), B<ftrylockfile>(), and B<funlockfile>()  functions are "
921 "thread-safe."
922 msgstr ""
923
924 #. type: Plain text
925 #: build/C/man3/flockfile.3:137 build/C/man3/popen.3:174
926 msgid "POSIX.1-2001."
927 msgstr ""
928
929 #. type: SH
930 #: build/C/man3/flockfile.3:137
931 #, no-wrap
932 msgid "AVAILABILITY"
933 msgstr ""
934
935 #. type: Plain text
936 #: build/C/man3/flockfile.3:143
937 msgid ""
938 "These functions are available when B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
939 "defined.  They are in libc since libc 5.1.1 and in glibc since glibc 2.0."
940 msgstr ""
941
942 #. type: Plain text
943 #: build/C/man3/flockfile.3:145
944 msgid "B<unlocked_stdio>(3)"
945 msgstr ""
946
947 #. type: TH
948 #: build/C/man3/fmemopen.3:10
949 #, no-wrap
950 msgid "FMEMOPEN"
951 msgstr ""
952
953 #. type: TH
954 #: build/C/man3/fmemopen.3:10
955 #, no-wrap
956 msgid "2012-04-28"
957 msgstr ""
958
959 #. type: Plain text
960 #: build/C/man3/fmemopen.3:13
961 msgid "fmemopen, open_memstream, open_wmemstream - open memory as stream"
962 msgstr ""
963
964 #. type: Plain text
965 #: build/C/man3/fmemopen.3:18
966 #, no-wrap
967 msgid ""
968 "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char "
969 "*>I<mode>B<);>\n"
970 msgstr ""
971
972 #. type: Plain text
973 #: build/C/man3/fmemopen.3:20
974 #, no-wrap
975 msgid "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
976 msgstr ""
977
978 #. type: Plain text
979 #: build/C/man3/fmemopen.3:24
980 #, no-wrap
981 msgid "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
982 msgstr ""
983
984 #. type: Plain text
985 #: build/C/man3/fmemopen.3:34
986 msgid "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
987 msgstr ""
988
989 #. type: Plain text
990 #: build/C/man3/fmemopen.3:57
991 msgid ""
992 "The B<fmemopen>()  function opens a stream that permits the access specified "
993 "by I<mode>.  The stream allows I/O to be performed on the string or memory "
994 "buffer pointed to by I<buf>.  This buffer must be at least I<size> bytes "
995 "long."
996 msgstr ""
997
998 #. type: Plain text
999 #: build/C/man3/fmemopen.3:77
1000 msgid ""
1001 "The argument I<mode> is the same as for B<fopen>(3).  If I<mode> specifies "
1002 "an append mode, then the initial file position is set to the location of the "
1003 "first null byte (\\(aq\\e0\\(aq) in the buffer; otherwise the initial file "
1004 "position is set to the start of the buffer.  Since glibc 2.9, the letter "
1005 "\\(aqb\\(aq may be specified as the second character in I<mode>.  This "
1006 "provides \"binary\" mode: writes don't implicitly add a terminating null "
1007 "byte, and B<fseek>(3)  B<SEEK_END> is relative to the end of the buffer "
1008 "(i.e., the value specified by the I<size> argument), rather than the current "
1009 "string length."
1010 msgstr ""
1011
1012 #. type: Plain text
1013 #: build/C/man3/fmemopen.3:89
1014 msgid ""
1015 "When a stream that has been opened for writing is flushed (B<fflush>(3))  or "
1016 "closed (B<fclose>(3)), a null byte is written at the end of the buffer if "
1017 "there is space.  The caller should ensure that an extra byte is available in "
1018 "the buffer (and that I<size> counts that byte)  to allow for this."
1019 msgstr ""
1020
1021 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1995
1022 #.  and
1023 #.  http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html
1024 #. type: Plain text
1025 #: build/C/man3/fmemopen.3:107
1026 msgid ""
1027 "Attempts to write more than I<size> bytes to the buffer result in an error.  "
1028 "(By default, such errors will be visible only when the I<stdio> buffer is "
1029 "flushed.  Disabling buffering with I<setbuf(fp,\\ NULL)> may be useful to "
1030 "detect errors at the time of an output operation.  Alternatively, the caller "
1031 "can explicitly set I<buf> as the stdio stream buffer, at the same time "
1032 "informing stdio of the buffer's size, using I<setbuffer(fp, buf, size)>.)"
1033 msgstr ""
1034
1035 #. type: Plain text
1036 #: build/C/man3/fmemopen.3:115
1037 msgid ""
1038 "In a stream opened for reading, null bytes (\\(aq\\e0\\(aq) in the buffer do "
1039 "not cause read operations to return an end-of-file indication.  A read from "
1040 "the buffer will only indicate end-of-file when the file pointer advances "
1041 "I<size> bytes past the start of the buffer."
1042 msgstr ""
1043
1044 #. type: Plain text
1045 #: build/C/man3/fmemopen.3:130
1046 msgid ""
1047 "If I<buf> is specified as NULL, then B<fmemopen>()  dynamically allocates a "
1048 "buffer I<size> bytes long.  This is useful for an application that wants to "
1049 "write data to a temporary buffer and then read it back again.  The buffer is "
1050 "automatically freed when the stream is closed.  Note that the caller has no "
1051 "way to obtain a pointer to the temporary buffer allocated by this call (but "
1052 "see B<open_memstream>()  below)."
1053 msgstr ""
1054
1055 #. type: Plain text
1056 #: build/C/man3/fmemopen.3:141
1057 msgid ""
1058 "The B<open_memstream>()  function opens a stream for writing to a buffer.  "
1059 "The buffer is dynamically allocated (as with B<malloc>(3)), and "
1060 "automatically grows as required.  After closing the stream, the caller "
1061 "should B<free>(3)  this buffer."
1062 msgstr ""
1063
1064 #. type: Plain text
1065 #: build/C/man3/fmemopen.3:156
1066 msgid ""
1067 "When the stream is closed (B<fclose>(3))  or flushed (B<fflush>(3)), the "
1068 "locations pointed to by I<ptr> and I<sizeloc> are updated to contain, "
1069 "respectively, a pointer to the buffer and the current size of the buffer.  "
1070 "These values remain valid only as long as the caller performs no further "
1071 "output on the stream.  If further output is performed, then the stream must "
1072 "again be flushed before trying to access these variables."
1073 msgstr ""
1074
1075 #. type: Plain text
1076 #: build/C/man3/fmemopen.3:162
1077 msgid ""
1078 "A null byte is maintained at the end of the buffer.  This byte is I<not> "
1079 "included in the size value stored at I<sizeloc>."
1080 msgstr ""
1081
1082 #. type: Plain text
1083 #: build/C/man3/fmemopen.3:170
1084 msgid ""
1085 "The stream's file position can be changed with B<fseek>(3)  or "
1086 "B<fseeko>(3).  Moving the file position past the end of the data already "
1087 "written fills the intervening space with zeros."
1088 msgstr ""
1089
1090 #. type: Plain text
1091 #: build/C/man3/fmemopen.3:176
1092 msgid ""
1093 "The B<open_wmemstream>()  is similar to B<open_memstream>(), but operates on "
1094 "wide characters instead of bytes."
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: build/C/man3/fmemopen.3:188
1099 msgid ""
1100 "Upon successful completion B<fmemopen>(), B<open_memstream>()  and "
1101 "B<open_wmemstream>()  return a I<FILE> pointer.  Otherwise, NULL is returned "
1102 "and I<errno> is set to indicate the error."
1103 msgstr ""
1104
1105 #. type: SH
1106 #: build/C/man3/fmemopen.3:188 build/C/man3/fmtmsg.3:222 build/C/man3/getline.3:135 build/C/man2/pipe.2:113 build/C/man2/readv.2:209
1107 #, no-wrap
1108 msgid "VERSIONS"
1109 msgstr ""
1110
1111 #. type: Plain text
1112 #: build/C/man3/fmemopen.3:195
1113 msgid ""
1114 "B<fmemopen>()  and B<open_memstream>()  were already available in glibc "
1115 "1.0.x.  B<open_wmemstream>()  is available since glibc 2.4."
1116 msgstr ""
1117
1118 #. type: Plain text
1119 #: build/C/man3/fmemopen.3:199
1120 msgid ""
1121 "POSIX.1-2008.  These functions are not specified in POSIX.1-2001, and are "
1122 "not widely available on other systems."
1123 msgstr ""
1124
1125 #.  http://austingroupbugs.net/view.php?id=396
1126 #. type: Plain text
1127 #: build/C/man3/fmemopen.3:207
1128 msgid ""
1129 "POSIX.1-2008 specifies that \\(aqb\\(aq in I<mode> shall be ignored.  "
1130 "However, Technical Corrigendum 1 adjusts the standard to allow "
1131 "implementation-specific treatment for this case, thus permitting the glibc "
1132 "treatment of \\(aqb\\(aq."
1133 msgstr ""
1134
1135 #. type: Plain text
1136 #: build/C/man3/fmemopen.3:213
1137 msgid ""
1138 "There is no file descriptor associated with the file stream returned by "
1139 "these functions (i.e., B<fileno>(3)  will return an error if called on the "
1140 "returned stream)."
1141 msgstr ""
1142
1143 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=1996
1144 #. type: Plain text
1145 #: build/C/man3/fmemopen.3:220
1146 msgid ""
1147 "In glibc before version 2.7, seeking past the end of a stream created by "
1148 "B<open_memstream>()  does not enlarge the buffer; instead the B<fseek>(3)  "
1149 "call fails, returning -1."
1150 msgstr ""
1151
1152 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=11216
1153 #. type: Plain text
1154 #: build/C/man3/fmemopen.3:231
1155 msgid ""
1156 "If I<size> is specified as zero, B<fmemopen>()  fails with the error "
1157 "B<EINVAL>.  It would be more consistent if this case successfully created a "
1158 "stream that then returned end of file on the first attempt at reading.  "
1159 "Furthermore, POSIX.1-2008 does not specify a failure for this case."
1160 msgstr ""
1161
1162 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13152
1163 #. type: Plain text
1164 #: build/C/man3/fmemopen.3:239
1165 msgid ""
1166 "Specifying append mode (\"a\" or \"a+\") for B<fmemopen>()  sets the initial "
1167 "file position to the first null byte, but (if the file offset is reset to a "
1168 "location other than the end of the stream)  does not force subsequent writes "
1169 "to append at the end of the stream."
1170 msgstr ""
1171
1172 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13151
1173 #. type: Plain text
1174 #: build/C/man3/fmemopen.3:255
1175 msgid ""
1176 "If the I<mode> argument to B<fmemopen>()  specifies append (\"a\" or "
1177 "\"a+\"), and the I<size> argument does not cover a null byte in I<buf> then, "
1178 "according to POSIX.1-2008, the initial file position should be set to the "
1179 "next byte after the end of the buffer.  However, in this case the glibc "
1180 "B<fmemopen>()  sets the file position to -1."
1181 msgstr ""
1182
1183 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12836
1184 #. type: Plain text
1185 #: build/C/man3/fmemopen.3:268
1186 msgid ""
1187 "To specify binary mode for B<fmemopen>()  the \\(aqb\\(aq must be the "
1188 "I<second> character in I<mode>.  Thus, for example, \"wb+\" has the desired "
1189 "effect, but \"w+b\" does not.  This is inconsistent with the treatment of "
1190 "I<mode> by B<fopen>(3)."
1191 msgstr ""
1192
1193 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=6544
1194 #. type: Plain text
1195 #: build/C/man3/fmemopen.3:276
1196 msgid ""
1197 "The glibc 2.9 addition of \"binary\" mode for B<fmemopen>()  silently "
1198 "changed the ABI: previously, B<fmemopen>()  ignored \\(aqb\\(aq in I<mode>."
1199 msgstr ""
1200
1201 #. type: SH
1202 #: build/C/man3/fmemopen.3:276 build/C/man3/fmtmsg.3:256 build/C/man3/fopencookie.3:247 build/C/man3/getline.3:144 build/C/man2/pipe.2:124 build/C/man3/printf.3:973 build/C/man2/readlink.2:157 build/C/man2/readv.2:265 build/C/man3/scanf.3:681
1203 #, no-wrap
1204 msgid "EXAMPLE"
1205 msgstr ""
1206
1207 #. type: Plain text
1208 #: build/C/man3/fmemopen.3:286
1209 msgid ""
1210 "The program below uses B<fmemopen>()  to open an input buffer, and "
1211 "B<open_memstream>()  to open a dynamically sized output buffer.  The program "
1212 "scans its input string (taken from the program's first command-line "
1213 "argument) reading integers, and writes the squares of these integers to the "
1214 "output buffer.  An example of the output produced by this program is the "
1215 "following:"
1216 msgstr ""
1217
1218 #. type: Plain text
1219 #: build/C/man3/fmemopen.3:291
1220 #, no-wrap
1221 msgid ""
1222 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1223 "size=11; ptr=1 529 1849\n"
1224 msgstr ""
1225
1226 #. type: SS
1227 #: build/C/man3/fmemopen.3:293 build/C/man3/fopencookie.3:271
1228 #, no-wrap
1229 msgid "Program source"
1230 msgstr ""
1231
1232 #. type: Plain text
1233 #: build/C/man3/fmemopen.3:300
1234 #, no-wrap
1235 msgid ""
1236 "#define _GNU_SOURCE\n"
1237 "#include E<lt>string.hE<gt>\n"
1238 "#include E<lt>stdio.hE<gt>\n"
1239 "#include E<lt>stdlib.hE<gt>\n"
1240 msgstr ""
1241
1242 #. type: Plain text
1243 #: build/C/man3/fmemopen.3:303
1244 #, no-wrap
1245 msgid ""
1246 "#define handle_error(msg) \\e\n"
1247 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1248 msgstr ""
1249
1250 #. type: Plain text
1251 #: build/C/man3/fmemopen.3:311
1252 #, no-wrap
1253 msgid ""
1254 "int\n"
1255 "main(int argc, char *argv[])\n"
1256 "{\n"
1257 "    FILE *out, *in;\n"
1258 "    int v, s;\n"
1259 "    size_t size;\n"
1260 "    char *ptr;\n"
1261 msgstr ""
1262
1263 #. type: Plain text
1264 #: build/C/man3/fmemopen.3:316
1265 #, no-wrap
1266 msgid ""
1267 "    if (argc != 2) {\n"
1268 "\tfprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1269 "\texit(EXIT_FAILURE);\n"
1270 "    }\n"
1271 msgstr ""
1272
1273 #. type: Plain text
1274 #: build/C/man3/fmemopen.3:320
1275 #, no-wrap
1276 msgid ""
1277 "    in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1278 "    if (in == NULL)\n"
1279 "        handle_error(\"fmemopen\");\n"
1280 msgstr ""
1281
1282 #. type: Plain text
1283 #: build/C/man3/fmemopen.3:324
1284 #, no-wrap
1285 msgid ""
1286 "    out = open_memstream(&ptr, &size);\n"
1287 "    if (out == NULL)\n"
1288 "        handle_error(\"open_memstream\");\n"
1289 msgstr ""
1290
1291 #. type: Plain text
1292 #: build/C/man3/fmemopen.3:329
1293 #, no-wrap
1294 msgid ""
1295 "    for (;;) {\n"
1296 "        s = fscanf(in, \"%d\", &v);\n"
1297 "        if (s E<lt>= 0)\n"
1298 "            break;\n"
1299 msgstr ""
1300
1301 #. type: Plain text
1302 #: build/C/man3/fmemopen.3:340
1303 #, no-wrap
1304 msgid ""
1305 "        s = fprintf(out, \"%d \", v * v);\n"
1306 "        if (s == -1)\n"
1307 "            handle_error(\"fprintf\");\n"
1308 "    }\n"
1309 "    fclose(in);\n"
1310 "    fclose(out);\n"
1311 "    printf(\"size=%ld; ptr=%s\\en\", (long) size, ptr);\n"
1312 "    free(ptr);\n"
1313 "    exit(EXIT_SUCCESS);\n"
1314 "}\n"
1315 msgstr ""
1316
1317 #. type: Plain text
1318 #: build/C/man3/fmemopen.3:344
1319 msgid "B<fopen>(3), B<fopencookie>(3)"
1320 msgstr ""
1321
1322 #. type: TH
1323 #: build/C/man3/fmtmsg.3:13
1324 #, no-wrap
1325 msgid "FMTMSG"
1326 msgstr ""
1327
1328 #. type: Plain text
1329 #: build/C/man3/fmtmsg.3:16
1330 msgid "fmtmsg - print formatted error messages"
1331 msgstr ""
1332
1333 #. type: Plain text
1334 #: build/C/man3/fmtmsg.3:19
1335 #, no-wrap
1336 msgid "B<#include E<lt>fmtmsg.hE<gt>>\n"
1337 msgstr ""
1338
1339 #. type: Plain text
1340 #: build/C/man3/fmtmsg.3:21
1341 #, no-wrap
1342 msgid "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
1343 msgstr ""
1344
1345 #. type: Plain text
1346 #: build/C/man3/fmtmsg.3:23
1347 #, no-wrap
1348 msgid "B<           int >I<severity>B<, const char *>I<text>B<,>\n"
1349 msgstr ""
1350
1351 #. type: Plain text
1352 #: build/C/man3/fmtmsg.3:25
1353 #, no-wrap
1354 msgid "B<           const char *>I<action>B<, const char *>I<tag>B<);>\n"
1355 msgstr ""
1356
1357 #. type: Plain text
1358 #: build/C/man3/fmtmsg.3:36
1359 msgid ""
1360 "This function displays a message described by its arguments on the device(s)  "
1361 "specified in the I<classification> argument.  For messages written to "
1362 "I<stderr>, the format depends on the B<MSGVERB> environment variable."
1363 msgstr ""
1364
1365 #. type: Plain text
1366 #: build/C/man3/fmtmsg.3:43
1367 msgid ""
1368 "The I<label> argument identifies the source of the message.  The string must "
1369 "consist of two colon separated parts where the first part has not more than "
1370 "10 and the second part not more than 14 characters."
1371 msgstr ""
1372
1373 #. type: Plain text
1374 #: build/C/man3/fmtmsg.3:47
1375 msgid "The I<text> argument describes the condition of the error."
1376 msgstr ""
1377
1378 #. type: Plain text
1379 #: build/C/man3/fmtmsg.3:52
1380 msgid ""
1381 "The I<action> argument describes possible steps to recover from the error.  "
1382 "If it is printed, it is prefixed by \"TO FIX: \"."
1383 msgstr ""
1384
1385 #. type: Plain text
1386 #: build/C/man3/fmtmsg.3:60
1387 msgid ""
1388 "The I<tag> argument is a reference to the online documentation where more "
1389 "information can be found.  It should contain the I<label> value and a unique "
1390 "identification number."
1391 msgstr ""
1392
1393 #. type: SS
1394 #: build/C/man3/fmtmsg.3:60
1395 #, no-wrap
1396 msgid "Dummy arguments"
1397 msgstr ""
1398
1399 #. type: Plain text
1400 #: build/C/man3/fmtmsg.3:79
1401 msgid ""
1402 "Each of the arguments can have a dummy value.  The dummy classification "
1403 "value B<MM_NULLMC> (0L) does not specify any output, so nothing is printed.  "
1404 "The dummy severity value B<NO_SEV> (0) says that no severity is supplied.  "
1405 "The values B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> are "
1406 "synonyms for I<((char\\ *)\\ 0)>, the empty string, and B<MM_NULLSEV> is a "
1407 "synonym for B<NO_SEV>."
1408 msgstr ""
1409
1410 #. type: SS
1411 #: build/C/man3/fmtmsg.3:79
1412 #, no-wrap
1413 msgid "The classification argument"
1414 msgstr ""
1415
1416 #. type: Plain text
1417 #: build/C/man3/fmtmsg.3:83
1418 msgid ""
1419 "The I<classification> argument is the sum of values describing 4 types of "
1420 "information."
1421 msgstr ""
1422
1423 #. type: Plain text
1424 #: build/C/man3/fmtmsg.3:86
1425 msgid "The first value defines the output channel."
1426 msgstr ""
1427
1428 #. type: TP
1429 #: build/C/man3/fmtmsg.3:86
1430 #, no-wrap
1431 msgid "B<MM_PRINT>"
1432 msgstr ""
1433
1434 #. type: Plain text
1435 #: build/C/man3/fmtmsg.3:90
1436 msgid "Output to I<stderr>."
1437 msgstr ""
1438
1439 #. type: TP
1440 #: build/C/man3/fmtmsg.3:90
1441 #, no-wrap
1442 msgid "B<MM_CONSOLE>"
1443 msgstr ""
1444
1445 #. type: Plain text
1446 #: build/C/man3/fmtmsg.3:93
1447 msgid "Output to the system console."
1448 msgstr ""
1449
1450 #. type: TP
1451 #: build/C/man3/fmtmsg.3:93
1452 #, no-wrap
1453 msgid "B<MM_PRINT | MM_CONSOLE>"
1454 msgstr ""
1455
1456 #. type: Plain text
1457 #: build/C/man3/fmtmsg.3:96
1458 msgid "Output to both."
1459 msgstr ""
1460
1461 #. type: Plain text
1462 #: build/C/man3/fmtmsg.3:98
1463 msgid "The second value is the source of the error:"
1464 msgstr ""
1465
1466 #. type: TP
1467 #: build/C/man3/fmtmsg.3:98
1468 #, no-wrap
1469 msgid "B<MM_HARD>"
1470 msgstr ""
1471
1472 #. type: Plain text
1473 #: build/C/man3/fmtmsg.3:101
1474 msgid "A hardware error occurred."
1475 msgstr ""
1476
1477 #. type: TP
1478 #: build/C/man3/fmtmsg.3:101
1479 #, no-wrap
1480 msgid "B<MM_FIRM>"
1481 msgstr ""
1482
1483 #. type: Plain text
1484 #: build/C/man3/fmtmsg.3:104
1485 msgid "A firmware error occurred."
1486 msgstr ""
1487
1488 #. type: TP
1489 #: build/C/man3/fmtmsg.3:104
1490 #, no-wrap
1491 msgid "B<MM_SOFT>"
1492 msgstr ""
1493
1494 #. type: Plain text
1495 #: build/C/man3/fmtmsg.3:107
1496 msgid "A software error occurred."
1497 msgstr ""
1498
1499 #. type: Plain text
1500 #: build/C/man3/fmtmsg.3:109
1501 msgid "The third value encodes the detector of the problem:"
1502 msgstr ""
1503
1504 #. type: TP
1505 #: build/C/man3/fmtmsg.3:109
1506 #, no-wrap
1507 msgid "B<MM_APPL>"
1508 msgstr ""
1509
1510 #. type: Plain text
1511 #: build/C/man3/fmtmsg.3:112
1512 msgid "It is detected by an application."
1513 msgstr ""
1514
1515 #. type: TP
1516 #: build/C/man3/fmtmsg.3:112
1517 #, no-wrap
1518 msgid "B<MM_UTIL>"
1519 msgstr ""
1520
1521 #. type: Plain text
1522 #: build/C/man3/fmtmsg.3:115
1523 msgid "It is detected by a utility."
1524 msgstr ""
1525
1526 #. type: TP
1527 #: build/C/man3/fmtmsg.3:115
1528 #, no-wrap
1529 msgid "B<MM_OPSYS>"
1530 msgstr ""
1531
1532 #. type: Plain text
1533 #: build/C/man3/fmtmsg.3:118
1534 msgid "It is detected by the operating system."
1535 msgstr ""
1536
1537 #. type: Plain text
1538 #: build/C/man3/fmtmsg.3:120
1539 msgid "The fourth value shows the severity of the incident:"
1540 msgstr ""
1541
1542 #. type: TP
1543 #: build/C/man3/fmtmsg.3:120
1544 #, no-wrap
1545 msgid "B<MM_RECOVER>"
1546 msgstr ""
1547
1548 #. type: Plain text
1549 #: build/C/man3/fmtmsg.3:123
1550 msgid "It is a recoverable error."
1551 msgstr ""
1552
1553 #. type: TP
1554 #: build/C/man3/fmtmsg.3:123
1555 #, no-wrap
1556 msgid "B<MM_NRECOV>"
1557 msgstr ""
1558
1559 #. type: Plain text
1560 #: build/C/man3/fmtmsg.3:126
1561 msgid "It is a nonrecoverable error."
1562 msgstr ""
1563
1564 #. type: SS
1565 #: build/C/man3/fmtmsg.3:126
1566 #, no-wrap
1567 msgid "The severity argument"
1568 msgstr ""
1569
1570 #. type: Plain text
1571 #: build/C/man3/fmtmsg.3:130
1572 msgid "The I<severity> argument can take one of the following values:"
1573 msgstr ""
1574
1575 #. type: TP
1576 #: build/C/man3/fmtmsg.3:130
1577 #, no-wrap
1578 msgid "B<MM_NOSEV>"
1579 msgstr ""
1580
1581 #. type: Plain text
1582 #: build/C/man3/fmtmsg.3:133
1583 msgid "No severity is printed."
1584 msgstr ""
1585
1586 #. type: TP
1587 #: build/C/man3/fmtmsg.3:133
1588 #, no-wrap
1589 msgid "B<MM_HALT>"
1590 msgstr ""
1591
1592 #. type: Plain text
1593 #: build/C/man3/fmtmsg.3:136
1594 msgid "This value is printed as HALT."
1595 msgstr ""
1596
1597 #. type: TP
1598 #: build/C/man3/fmtmsg.3:136
1599 #, no-wrap
1600 msgid "B<MM_ERROR>"
1601 msgstr ""
1602
1603 #. type: Plain text
1604 #: build/C/man3/fmtmsg.3:139
1605 msgid "This value is printed as ERROR."
1606 msgstr ""
1607
1608 #. type: TP
1609 #: build/C/man3/fmtmsg.3:139
1610 #, no-wrap
1611 msgid "B<MM_WARNING>"
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man3/fmtmsg.3:142
1616 msgid "This value is printed as WARNING."
1617 msgstr ""
1618
1619 #. type: TP
1620 #: build/C/man3/fmtmsg.3:142
1621 #, no-wrap
1622 msgid "B<MM_INFO>"
1623 msgstr ""
1624
1625 #. type: Plain text
1626 #: build/C/man3/fmtmsg.3:145
1627 msgid "This value is printed as INFO."
1628 msgstr ""
1629
1630 #. type: Plain text
1631 #: build/C/man3/fmtmsg.3:152
1632 msgid ""
1633 "The numeric values are between 0 and 4.  Using B<addseverity>(3)  or the "
1634 "environment variable B<SEV_LEVEL> you can add more levels and strings to "
1635 "print."
1636 msgstr ""
1637
1638 #. type: Plain text
1639 #: build/C/man3/fmtmsg.3:154
1640 msgid "The function can return 4 values:"
1641 msgstr ""
1642
1643 #. type: TP
1644 #: build/C/man3/fmtmsg.3:154
1645 #, no-wrap
1646 msgid "B<MM_OK>"
1647 msgstr ""
1648
1649 #. type: Plain text
1650 #: build/C/man3/fmtmsg.3:157
1651 msgid "Everything went smooth."
1652 msgstr ""
1653
1654 #. type: TP
1655 #: build/C/man3/fmtmsg.3:157
1656 #, no-wrap
1657 msgid "B<MM_NOTOK>"
1658 msgstr ""
1659
1660 #. type: Plain text
1661 #: build/C/man3/fmtmsg.3:160
1662 msgid "Complete failure."
1663 msgstr ""
1664
1665 #. type: TP
1666 #: build/C/man3/fmtmsg.3:160
1667 #, no-wrap
1668 msgid "B<MM_NOMSG>"
1669 msgstr ""
1670
1671 #. type: Plain text
1672 #: build/C/man3/fmtmsg.3:164
1673 msgid "Error writing to I<stderr>."
1674 msgstr ""
1675
1676 #. type: TP
1677 #: build/C/man3/fmtmsg.3:164
1678 #, no-wrap
1679 msgid "B<MM_NOCON>"
1680 msgstr ""
1681
1682 #. type: Plain text
1683 #: build/C/man3/fmtmsg.3:167
1684 msgid "Error writing to the console."
1685 msgstr ""
1686
1687 #. type: SH
1688 #: build/C/man3/fmtmsg.3:167
1689 #, no-wrap
1690 msgid "ENVIRONMENT"
1691 msgstr ""
1692
1693 #. type: Plain text
1694 #: build/C/man3/fmtmsg.3:178
1695 msgid ""
1696 "The environment variable B<MSGVERB> (\"message verbosity\") can be used to "
1697 "suppress parts of the output to I<stderr>.  (It does not influence output to "
1698 "the console.)  When this variable is defined, is non-NULL, and is a "
1699 "colon-separated list of valid keywords, then only the parts of the message "
1700 "corresponding to these keywords is printed.  Valid keywords are \"label\", "
1701 "\"severity\", \"text\", \"action\" and \"tag\"."
1702 msgstr ""
1703
1704 #. type: Plain text
1705 #: build/C/man3/fmtmsg.3:190
1706 msgid ""
1707 "The environment variable B<SEV_LEVEL> can be used to introduce new severity "
1708 "levels.  By default, only the five severity levels described above are "
1709 "available.  Any other numeric value would make B<fmtmsg>()  print nothing.  "
1710 "If the user puts B<SEV_LEVEL> with a format like"
1711 msgstr ""
1712
1713 #. type: Plain text
1714 #: build/C/man3/fmtmsg.3:193
1715 msgid "SEV_LEVEL=[description[:description[:...]]]"
1716 msgstr ""
1717
1718 #. type: Plain text
1719 #: build/C/man3/fmtmsg.3:198
1720 msgid ""
1721 "in the environment of the process before the first call to B<fmtmsg>(), "
1722 "where each description is of the form"
1723 msgstr ""
1724
1725 #. type: Plain text
1726 #: build/C/man3/fmtmsg.3:201
1727 msgid "severity-keyword,level,printstring"
1728 msgstr ""
1729
1730 #. type: Plain text
1731 #: build/C/man3/fmtmsg.3:208
1732 msgid ""
1733 "then B<fmtmsg>()  will also accept the indicated values for the level (in "
1734 "addition to the standard levels 0-4), and use the indicated printstring when "
1735 "such a level occurs."
1736 msgstr ""
1737
1738 #. type: Plain text
1739 #: build/C/man3/fmtmsg.3:222
1740 msgid ""
1741 "The severity-keyword part is not used by B<fmtmsg>()  but it has to be "
1742 "present.  The level part is a string representation of a number.  The "
1743 "numeric value must be a number greater than 4.  This value must be used in "
1744 "the severity argument of B<fmtmsg>()  to select this class.  It is not "
1745 "possible to overwrite any of the predefined classes.  The printstring is the "
1746 "string printed when a message of this class is processed by B<fmtmsg>()."
1747 msgstr ""
1748
1749 #. type: Plain text
1750 #: build/C/man3/fmtmsg.3:225
1751 msgid "B<fmtmsg>()  is provided in glibc since version 2.1."
1752 msgstr ""
1753
1754 #. type: Plain text
1755 #: build/C/man3/fmtmsg.3:231
1756 msgid ""
1757 "Before glibc 2.16, the B<fmtmsg>()  function uses a static variable that is "
1758 "not protected, so it is not thread-safe."
1759 msgstr ""
1760
1761 #.  Modified in commit 7724defcf8873116fe4efab256596861eef21a94
1762 #. type: Plain text
1763 #: build/C/man3/fmtmsg.3:237
1764 msgid ""
1765 "Since glibc 2.16, the B<fmtmsg>()  function uses a lock to protect the "
1766 "static variable, so it is thread-safe."
1767 msgstr ""
1768
1769 #. type: Plain text
1770 #: build/C/man3/fmtmsg.3:252
1771 msgid ""
1772 "The functions B<fmtmsg>()  and B<addseverity>(3), and environment variables "
1773 "B<MSGVERB> and B<SEV_LEVEL> come from System V.  The function B<fmtmsg>()  "
1774 "and the environment variable B<MSGVERB> are described in POSIX.1-2001."
1775 msgstr ""
1776
1777 #. type: Plain text
1778 #: build/C/man3/fmtmsg.3:256
1779 msgid ""
1780 "System V and UnixWare man pages tell us that these functions have been "
1781 "replaced by \"pfmt() and addsev()\" or by \"pfmt(), vpfmt(), lfmt(), and "
1782 "vlfmt()\", and will be removed later."
1783 msgstr ""
1784
1785 #. type: Plain text
1786 #: build/C/man3/fmtmsg.3:261
1787 #, no-wrap
1788 msgid ""
1789 "#include E<lt>stdio.hE<gt>\n"
1790 "#include E<lt>stdlib.hE<gt>\n"
1791 "#include E<lt>fmtmsg.hE<gt>\n"
1792 msgstr ""
1793
1794 #. type: Plain text
1795 #: build/C/man3/fmtmsg.3:267
1796 #, no-wrap
1797 msgid ""
1798 "int\n"
1799 "main(void)\n"
1800 "{\n"
1801 "    long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
1802 "    int err;\n"
1803 msgstr ""
1804
1805 #. type: Plain text
1806 #: build/C/man3/fmtmsg.3:288
1807 #, no-wrap
1808 msgid ""
1809 "    err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
1810 "                \"unknown mount option\", \"See mount(8).\",\n"
1811 "                \"util-linux:mount:017\");\n"
1812 "    switch (err) {\n"
1813 "    case MM_OK:\n"
1814 "        break;\n"
1815 "    case MM_NOTOK:\n"
1816 "        printf(\"Nothing printed\\en\");\n"
1817 "        break;\n"
1818 "    case MM_NOMSG:\n"
1819 "        printf(\"Nothing printed to stderr\\en\");\n"
1820 "        break;\n"
1821 "    case MM_NOCON:\n"
1822 "        printf(\"No console output\\en\");\n"
1823 "        break;\n"
1824 "    default:\n"
1825 "        printf(\"Unknown error from fmtmsg()\\en\");\n"
1826 "    }\n"
1827 "    exit(EXIT_SUCCESS);\n"
1828 "}\n"
1829 msgstr ""
1830
1831 #. type: Plain text
1832 #: build/C/man3/fmtmsg.3:291
1833 msgid "The output should be:"
1834 msgstr ""
1835
1836 #. type: Plain text
1837 #: build/C/man3/fmtmsg.3:295
1838 #, no-wrap
1839 msgid ""
1840 "    util-linux:mount: ERROR: unknown mount option\n"
1841 "    TO FIX: See mount(8).  util-linux:mount:017\n"
1842 msgstr ""
1843
1844 #. type: Plain text
1845 #: build/C/man3/fmtmsg.3:298
1846 msgid "and after"
1847 msgstr ""
1848
1849 #. type: Plain text
1850 #: build/C/man3/fmtmsg.3:301
1851 #, no-wrap
1852 msgid "    MSGVERB=text:action; export MSGVERB\n"
1853 msgstr ""
1854
1855 #. type: Plain text
1856 #: build/C/man3/fmtmsg.3:304
1857 msgid "the output becomes:"
1858 msgstr ""
1859
1860 #. type: Plain text
1861 #: build/C/man3/fmtmsg.3:308
1862 #, no-wrap
1863 msgid ""
1864 "    unknown mount option\n"
1865 "    TO FIX: See mount(8).\n"
1866 msgstr ""
1867
1868 #. type: Plain text
1869 #: build/C/man3/fmtmsg.3:312
1870 msgid "B<addseverity>(3), B<perror>(3)"
1871 msgstr ""
1872
1873 #. type: TH
1874 #: build/C/man3/fopen.3:44
1875 #, no-wrap
1876 msgid "FOPEN"
1877 msgstr ""
1878
1879 #. type: TH
1880 #: build/C/man3/fopen.3:44
1881 #, no-wrap
1882 msgid "2012-04-22"
1883 msgstr ""
1884
1885 #. type: Plain text
1886 #: build/C/man3/fopen.3:47
1887 msgid "fopen, fdopen, freopen - stream open functions"
1888 msgstr ""
1889
1890 #. type: Plain text
1891 #: build/C/man3/fopen.3:52
1892 #, no-wrap
1893 msgid "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
1894 msgstr ""
1895
1896 #. type: Plain text
1897 #: build/C/man3/fopen.3:54
1898 #, no-wrap
1899 msgid "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
1900 msgstr ""
1901
1902 #. type: Plain text
1903 #: build/C/man3/fopen.3:56
1904 #, no-wrap
1905 msgid ""
1906 "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE "
1907 "*>I<stream>B<);>\n"
1908 msgstr ""
1909
1910 #. type: Plain text
1911 #: build/C/man3/fopen.3:65
1912 msgid "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1913 msgstr ""
1914
1915 #. type: Plain text
1916 #: build/C/man3/fopen.3:71
1917 msgid ""
1918 "The B<fopen>()  function opens the file whose name is the string pointed to "
1919 "by I<path> and associates a stream with it."
1920 msgstr ""
1921
1922 #. type: Plain text
1923 #: build/C/man3/fopen.3:76
1924 msgid ""
1925 "The argument I<mode> points to a string beginning with one of the following "
1926 "sequences (possibly followed by additional characters, as described below):"
1927 msgstr ""
1928
1929 #. type: TP
1930 #: build/C/man3/fopen.3:76
1931 #, no-wrap
1932 msgid "B<r>"
1933 msgstr ""
1934
1935 #. type: Plain text
1936 #: build/C/man3/fopen.3:80
1937 msgid ""
1938 "Open text file for reading.  The stream is positioned at the beginning of "
1939 "the file."
1940 msgstr ""
1941
1942 #. type: TP
1943 #: build/C/man3/fopen.3:80
1944 #, no-wrap
1945 msgid "B<r+>"
1946 msgstr ""
1947
1948 #. type: Plain text
1949 #: build/C/man3/fopen.3:84
1950 msgid ""
1951 "Open for reading and writing.  The stream is positioned at the beginning of "
1952 "the file."
1953 msgstr ""
1954
1955 #. type: TP
1956 #: build/C/man3/fopen.3:84
1957 #, no-wrap
1958 msgid "B<w>"
1959 msgstr ""
1960
1961 #. type: Plain text
1962 #: build/C/man3/fopen.3:88
1963 msgid ""
1964 "Truncate file to zero length or create text file for writing.  The stream is "
1965 "positioned at the beginning of the file."
1966 msgstr ""
1967
1968 #. type: TP
1969 #: build/C/man3/fopen.3:88
1970 #, no-wrap
1971 msgid "B<w+>"
1972 msgstr ""
1973
1974 #. type: Plain text
1975 #: build/C/man3/fopen.3:94
1976 msgid ""
1977 "Open for reading and writing.  The file is created if it does not exist, "
1978 "otherwise it is truncated.  The stream is positioned at the beginning of the "
1979 "file."
1980 msgstr ""
1981
1982 #. type: TP
1983 #: build/C/man3/fopen.3:94 build/C/man3/scanf.3:447
1984 #, no-wrap
1985 msgid "B<a>"
1986 msgstr ""
1987
1988 #. type: Plain text
1989 #: build/C/man3/fopen.3:99
1990 msgid ""
1991 "Open for appending (writing at end of file).  The file is created if it does "
1992 "not exist.  The stream is positioned at the end of the file."
1993 msgstr ""
1994
1995 #. type: TP
1996 #: build/C/man3/fopen.3:99
1997 #, no-wrap
1998 msgid "B<a+>"
1999 msgstr ""
2000
2001 #. type: Plain text
2002 #: build/C/man3/fopen.3:105
2003 msgid ""
2004 "Open for reading and appending (writing at end of file).  The file is "
2005 "created if it does not exist.  The initial file position for reading is at "
2006 "the beginning of the file, but output is always appended to the end of the "
2007 "file."
2008 msgstr ""
2009
2010 #. type: Plain text
2011 #: build/C/man3/fopen.3:118
2012 msgid ""
2013 "The I<mode> string can also include the letter \\(aqb\\(aq either as a last "
2014 "character or as a character between the characters in any of the "
2015 "two-character strings described above.  This is strictly for compatibility "
2016 "with C89 and has no effect; the \\(aqb\\(aq is ignored on all POSIX "
2017 "conforming systems, including Linux.  (Other systems may treat text files "
2018 "and binary files differently, and adding the \\(aqb\\(aq may be a good idea "
2019 "if you do I/O to a binary file and expect that your program may be ported to "
2020 "non-UNIX environments.)"
2021 msgstr ""
2022
2023 #. type: Plain text
2024 #: build/C/man3/fopen.3:121
2025 msgid "See NOTES below for details of glibc extensions for I<mode>."
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man3/fopen.3:126
2030 msgid ""
2031 "Any created files will have mode B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
2032 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666), as modified by the process's "
2033 "umask value (see B<umask>(2))."
2034 msgstr ""
2035
2036 #. type: Plain text
2037 #: build/C/man3/fopen.3:141
2038 msgid ""
2039 "Reads and writes may be intermixed on read/write streams in any order.  Note "
2040 "that ANSI C requires that a file positioning function intervene between "
2041 "output and input, unless an input operation encounters end-of-file.  (If "
2042 "this condition is not met, then a read is allowed to return the result of "
2043 "writes other than the most recent.)  Therefore it is good practice (and "
2044 "indeed sometimes necessary under Linux) to put an B<fseek>(3)  or "
2045 "B<fgetpos>(3)  operation between write and read operations on such a "
2046 "stream.  This operation may be an apparent no-op (as in I<fseek(..., 0L, "
2047 "SEEK_CUR)> called for its synchronizing side effect."
2048 msgstr ""
2049
2050 #. type: Plain text
2051 #: build/C/man3/fopen.3:146
2052 msgid ""
2053 "Opening a file in append mode (B<a> as the first character of I<mode>)  "
2054 "causes all subsequent write operations to this stream to occur at "
2055 "end-of-file, as if preceded the call:"
2056 msgstr ""
2057
2058 #. type: Plain text
2059 #: build/C/man3/fopen.3:149
2060 #, no-wrap
2061 msgid "    fseek(stream, 0, SEEK_END);\n"
2062 msgstr ""
2063
2064 #. type: Plain text
2065 #: build/C/man3/fopen.3:171
2066 msgid ""
2067 "The B<fdopen>()  function associates a stream with the existing file "
2068 "descriptor, I<fd>.  The I<mode> of the stream (one of the values \"r\", "
2069 "\"r+\", \"w\", \"w+\", \"a\", \"a+\")  must be compatible with the mode of "
2070 "the file descriptor.  The file position indicator of the new stream is set "
2071 "to that belonging to I<fd>, and the error and end-of-file indicators are "
2072 "cleared.  Modes \"w\" or \"w+\" do not cause truncation of the file.  The "
2073 "file descriptor is not dup'ed, and will be closed when the stream created by "
2074 "B<fdopen>()  is closed.  The result of applying B<fdopen>()  to a shared "
2075 "memory object is undefined."
2076 msgstr ""
2077
2078 #. type: Plain text
2079 #: build/C/man3/fopen.3:189
2080 msgid ""
2081 "The B<freopen>()  function opens the file whose name is the string pointed "
2082 "to by I<path> and associates the stream pointed to by I<stream> with it.  "
2083 "The original stream (if it exists) is closed.  The I<mode> argument is used "
2084 "just as in the B<fopen>()  function.  The primary use of the B<freopen>()  "
2085 "function is to change the file associated with a standard text stream "
2086 "(I<stderr>, I<stdin>, or I<stdout>)."
2087 msgstr ""
2088
2089 #. type: Plain text
2090 #: build/C/man3/fopen.3:201
2091 msgid ""
2092 "Upon successful completion B<fopen>(), B<fdopen>()  and B<freopen>()  return "
2093 "a I<FILE> pointer.  Otherwise, NULL is returned and I<errno> is set to "
2094 "indicate the error."
2095 msgstr ""
2096
2097 #. type: TP
2098 #: build/C/man3/fopen.3:202 build/C/man3/fseek.3:142 build/C/man3/getline.3:126 build/C/man2/llseek.2:77 build/C/man2/lseek.2:175 build/C/man2/pipe.2:102 build/C/man2/read.2:126 build/C/man2/read.2:137 build/C/man2/readlink.2:95 build/C/man2/readlink.2:104 build/C/man2/readv.2:200 build/C/man2/rename.2:139 build/C/man2/rmdir.2:67 build/C/man3/scanf.3:565 build/C/man2/write.2:154
2099 #, no-wrap
2100 msgid "B<EINVAL>"
2101 msgstr ""
2102
2103 #. type: Plain text
2104 #: build/C/man3/fopen.3:212
2105 msgid ""
2106 "The I<mode> provided to B<fopen>(), B<fdopen>(), or B<freopen>()  was "
2107 "invalid."
2108 msgstr ""
2109
2110 #. type: Plain text
2111 #: build/C/man3/fopen.3:222
2112 msgid ""
2113 "The B<fopen>(), B<fdopen>()  and B<freopen>()  functions may also fail and "
2114 "set I<errno> for any of the errors specified for the routine B<malloc>(3)."
2115 msgstr ""
2116
2117 #. type: Plain text
2118 #: build/C/man3/fopen.3:229
2119 msgid ""
2120 "The B<fopen>()  function may also fail and set I<errno> for any of the "
2121 "errors specified for the routine B<open>(2)."
2122 msgstr ""
2123
2124 #. type: Plain text
2125 #: build/C/man3/fopen.3:236
2126 msgid ""
2127 "The B<fdopen>()  function may also fail and set I<errno> for any of the "
2128 "errors specified for the routine B<fcntl>(2)."
2129 msgstr ""
2130
2131 #. type: Plain text
2132 #: build/C/man3/fopen.3:246
2133 msgid ""
2134 "The B<freopen>()  function may also fail and set I<errno> for any of the "
2135 "errors specified for the routines B<open>(2), B<fclose>(3)  and "
2136 "B<fflush>(3)."
2137 msgstr ""
2138
2139 #. type: Plain text
2140 #: build/C/man3/fopen.3:255
2141 msgid ""
2142 "The B<fopen>()  and B<freopen>()  functions conform to C89.  The B<fdopen>()  "
2143 "function conforms to POSIX.1-1990."
2144 msgstr ""
2145
2146 #. type: SS
2147 #: build/C/man3/fopen.3:256
2148 #, no-wrap
2149 msgid "Glibc notes"
2150 msgstr ""
2151
2152 #. type: Plain text
2153 #: build/C/man3/fopen.3:259
2154 msgid ""
2155 "The GNU C library allows the following extensions for the string specified "
2156 "in I<mode>:"
2157 msgstr ""
2158
2159 #. type: TP
2160 #: build/C/man3/fopen.3:259
2161 #, no-wrap
2162 msgid "B<c> (since glibc 2.3.3)"
2163 msgstr ""
2164
2165 #. type: Plain text
2166 #: build/C/man3/fopen.3:266
2167 msgid ""
2168 "Do not make the open operation, or subsequent read and write operations, "
2169 "thread cancellation points.  This flag is ignored for B<fdopen>()."
2170 msgstr ""
2171
2172 #. type: TP
2173 #: build/C/man3/fopen.3:266
2174 #, no-wrap
2175 msgid "B<e> (since glibc 2.7)"
2176 msgstr ""
2177
2178 #. type: Plain text
2179 #: build/C/man3/fopen.3:276
2180 msgid ""
2181 "Open the file with the B<O_CLOEXEC> flag.  See B<open>(2)  for more "
2182 "information.  This flag is ignored for B<fdopen>()."
2183 msgstr ""
2184
2185 #. type: TP
2186 #: build/C/man3/fopen.3:276
2187 #, no-wrap
2188 msgid "B<m> (since glibc 2.3)"
2189 msgstr ""
2190
2191 #.  As at glibc 2.4:
2192 #. type: Plain text
2193 #: build/C/man3/fopen.3:288
2194 msgid ""
2195 "Attempt to access the file using B<mmap>(2), rather than I/O system calls "
2196 "(B<read>(2), B<write>(2)).  Currently, use of B<mmap>(2)  is attempted only "
2197 "for a file opened for reading."
2198 msgstr ""
2199
2200 #. type: TP
2201 #: build/C/man3/fopen.3:288 build/C/man3/scanf.3:421
2202 #, no-wrap
2203 msgid "B<x>"
2204 msgstr ""
2205
2206 #.  Since glibc 2.0?
2207 #.  FIXME C11 specifies this flag
2208 #. type: Plain text
2209 #: build/C/man3/fopen.3:305
2210 msgid ""
2211 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)).  If the "
2212 "file already exists, B<fopen>()  fails, and sets I<errno> to B<EEXIST>.  "
2213 "This flag is ignored for B<fdopen>()."
2214 msgstr ""
2215
2216 #. type: Plain text
2217 #: build/C/man3/fopen.3:313
2218 msgid ""
2219 "In addition to the above characters, B<fopen>()  and B<freopen>()  support "
2220 "the following syntax in I<mode>:"
2221 msgstr ""
2222
2223 #. type: Plain text
2224 #: build/C/man3/fopen.3:315
2225 msgid "B< ,ccs=>I<string>"
2226 msgstr ""
2227
2228 #. type: Plain text
2229 #: build/C/man3/fopen.3:331
2230 msgid ""
2231 "The given I<string> is taken as the name of a coded character set and the "
2232 "stream is marked as wide-oriented.  Thereafter, internal conversion "
2233 "functions convert I/O to and from the character set I<string>.  If the "
2234 "B<,ccs=>I<string> syntax is not specified, then the wide-orientation of the "
2235 "stream is determined by the first file operation.  If that operation is a "
2236 "wide-character operation, the stream is marked wide-oriented, and functions "
2237 "to convert to the coded character set are loaded."
2238 msgstr ""
2239
2240 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12685
2241 #. type: Plain text
2242 #: build/C/man3/fopen.3:348
2243 msgid ""
2244 "When parsing for individual flag characters in I<mode> (i.e., the characters "
2245 "preceding the \"ccs\" specification), the glibc implementation of B<fopen>()  "
2246 "and B<freopen>()  limits the number of characters examined in I<mode> to 7 "
2247 "(or, in glibc versions before 2.14, to 6, which was not enough to include "
2248 "possible specifications such as \"rb+cmxe\").  The current implementation of "
2249 "B<fdopen>()  parses at most 5 characters in I<mode>."
2250 msgstr ""
2251
2252 #. type: Plain text
2253 #: build/C/man3/fopen.3:354
2254 msgid "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
2255 msgstr ""
2256
2257 #. type: TH
2258 #: build/C/man3/fopencookie.3:26
2259 #, no-wrap
2260 msgid "FOPENCOOKIE"
2261 msgstr ""
2262
2263 #. type: TH
2264 #: build/C/man3/fopencookie.3:26
2265 #, no-wrap
2266 msgid "2013-03-17"
2267 msgstr ""
2268
2269 #. type: TH
2270 #: build/C/man3/fopencookie.3:26 build/C/man2/link.2:31 build/C/man2/llseek.2:28 build/C/man2/lseek.2:47 build/C/man3/lseek64.3:25 build/C/man2/open.2:51 build/C/man2/pipe.2:36 build/C/man2/read.2:35 build/C/man2/readlink.2:43 build/C/man2/readv.2:32 build/C/man2/rename.2:32 build/C/man2/rmdir.2:30 build/C/man3/setbuf.3:48 build/C/man3/stdin.3:13 build/C/man2/symlink.2:32 build/C/man7/symlink.7:36 build/C/man2/unlink.2:32 build/C/man2/write.2:39
2271 #, no-wrap
2272 msgid "Linux"
2273 msgstr ""
2274
2275 #. type: Plain text
2276 #: build/C/man3/fopencookie.3:29
2277 msgid "fopencookie - opening a custom stream"
2278 msgstr ""
2279
2280 #. type: Plain text
2281 #: build/C/man3/fopencookie.3:36
2282 #, no-wrap
2283 msgid ""
2284 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
2285 "B<                  cookie_io_functions_t >I<io_funcs>B<);>\n"
2286 msgstr ""
2287
2288 #. type: Plain text
2289 #: build/C/man3/fopencookie.3:49
2290 msgid ""
2291 "The B<fopencookie>()  function allows the programmer to create a custom "
2292 "implementation for a standard I/O stream.  This implementation can store the "
2293 "stream's data at a location of its own choosing; for example, "
2294 "B<fopencookie>()  is used to implement B<fmemopen>(3), which provides a "
2295 "stream interface to data that is stored in a buffer in memory."
2296 msgstr ""
2297
2298 #. type: Plain text
2299 #: build/C/man3/fopencookie.3:51
2300 msgid "In order to create a custom stream the programmer must:"
2301 msgstr ""
2302
2303 #. type: IP
2304 #: build/C/man3/fopencookie.3:51 build/C/man3/fopencookie.3:54 build/C/man3/fopencookie.3:65 build/C/man2/open.2:469 build/C/man2/open.2:477 build/C/man2/open.2:483 build/C/man2/open.2:489 build/C/man2/open.2:496 build/C/man2/open.2:502 build/C/man3/scanf.3:633 build/C/man3/scanf.3:638 build/C/man3/scanf.3:644 build/C/man7/symlink.7:249 build/C/man7/symlink.7:259 build/C/man7/symlink.7:289 build/C/man7/symlink.7:349 build/C/man7/symlink.7:378 build/C/man7/symlink.7:407 build/C/man7/symlink.7:438 build/C/man7/symlink.7:451
2305 #, no-wrap
2306 msgid "*"
2307 msgstr ""
2308
2309 #. type: Plain text
2310 #: build/C/man3/fopencookie.3:54
2311 msgid ""
2312 "Implement four \"hook\" functions that are used internally by the standard "
2313 "I/O library when performing I/O on the stream."
2314 msgstr ""
2315
2316 #. type: Plain text
2317 #: build/C/man3/fopencookie.3:65
2318 msgid ""
2319 "Define a \"cookie\" data type, a structure that provides bookkeeping "
2320 "information (e.g., where to store data) used by the aforementioned hook "
2321 "functions.  The standard I/O package knows nothing about the contents of "
2322 "this cookie (thus it is typed as I<void\\ *> when passed to "
2323 "B<fopencookie>()), but automatically supplies the cookie as the first "
2324 "argument when calling the hook functions."
2325 msgstr ""
2326
2327 #. type: Plain text
2328 #: build/C/man3/fopencookie.3:70
2329 msgid ""
2330 "Call B<fopencookie>()  to open a new stream and associate the cookie and "
2331 "hook functions with that stream."
2332 msgstr ""
2333
2334 #. type: Plain text
2335 #: build/C/man3/fopencookie.3:78
2336 msgid ""
2337 "The B<fopencookie>()  function serves a purpose similar to B<fopen>(3): it "
2338 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
2339 "operate on that stream."
2340 msgstr ""
2341
2342 #. type: Plain text
2343 #: build/C/man3/fopencookie.3:85
2344 msgid ""
2345 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
2346 "to be associated with the new stream.  This pointer is supplied as the first "
2347 "argument when the standard I/O library invokes any of the hook functions "
2348 "described below."
2349 msgstr ""
2350
2351 #. type: Plain text
2352 #: build/C/man3/fopencookie.3:101
2353 msgid ""
2354 "The I<mode> argument serves the same purpose as for B<fopen>(3).  The "
2355 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>.  "
2356 "See B<fopen>(3)  for details."
2357 msgstr ""
2358
2359 #. type: Plain text
2360 #: build/C/man3/fopencookie.3:107
2361 msgid ""
2362 "The I<io_funcs> argument is a structure that contains four fields pointing "
2363 "to the programmer-defined hook functions that are used to implement this "
2364 "stream.  The structure is defined as follows"
2365 msgstr ""
2366
2367 #. type: Plain text
2368 #: build/C/man3/fopencookie.3:116
2369 #, no-wrap
2370 msgid ""
2371 "typedef struct {\n"
2372 "    cookie_read_function_t  *read;\n"
2373 "    cookie_write_function_t *write;\n"
2374 "    cookie_seek_function_t  *seek;\n"
2375 "    cookie_close_function_t *close;\n"
2376 "} cookie_io_functions_t;\n"
2377 msgstr ""
2378
2379 #. type: Plain text
2380 #: build/C/man3/fopencookie.3:120
2381 msgid "The four fields are as follows:"
2382 msgstr ""
2383
2384 #. type: TP
2385 #: build/C/man3/fopencookie.3:120
2386 #, no-wrap
2387 msgid "I<cookie_read_function_t *read>"
2388 msgstr ""
2389
2390 #. type: Plain text
2391 #: build/C/man3/fopencookie.3:124
2392 msgid ""
2393 "This function implements read operations for the stream.  When called, it "
2394 "receives three arguments:"
2395 msgstr ""
2396
2397 #. type: Plain text
2398 #: build/C/man3/fopencookie.3:126
2399 #, no-wrap
2400 msgid "    ssize_t read(void *cookie, char *buf, size_t size);\n"
2401 msgstr ""
2402
2403 #. type: Plain text
2404 #: build/C/man3/fopencookie.3:141
2405 msgid ""
2406 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
2407 "input data can be placed and the size of that buffer.  As its function "
2408 "result, the I<read> function should return the number of bytes copied into "
2409 "I<buf>, 0 on end of file, or -1 on error.  The I<read> function should "
2410 "update the stream offset appropriately."
2411 msgstr ""
2412
2413 #. type: Plain text
2414 #: build/C/man3/fopencookie.3:146
2415 msgid ""
2416 "If I<*read> is a NULL pointer, then reads from the custom stream always "
2417 "return end of file."
2418 msgstr ""
2419
2420 #. type: TP
2421 #: build/C/man3/fopencookie.3:146
2422 #, no-wrap
2423 msgid "I<cookie_write_function_t *write>"
2424 msgstr ""
2425
2426 #. type: Plain text
2427 #: build/C/man3/fopencookie.3:150
2428 msgid ""
2429 "This function implements write operations for the stream.  When called, it "
2430 "receives three arguments:"
2431 msgstr ""
2432
2433 #. type: Plain text
2434 #: build/C/man3/fopencookie.3:152
2435 #, no-wrap
2436 msgid "    ssize_t write(void *cookie, const char *buf, size_t size);\n"
2437 msgstr ""
2438
2439 #. type: Plain text
2440 #: build/C/man3/fopencookie.3:168
2441 msgid ""
2442 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
2443 "output to the stream and the size of that buffer.  As its function result, "
2444 "the I<write> function should return the number of bytes copied from I<buf>, "
2445 "or 0 on error.  (The function must not return a negative value.)  The "
2446 "I<write> function should update the stream offset appropriately."
2447 msgstr ""
2448
2449 #. type: Plain text
2450 #: build/C/man3/fopencookie.3:173
2451 msgid "If I<*write> is a NULL pointer, then output to the stream is discarded."
2452 msgstr ""
2453
2454 #. type: TP
2455 #: build/C/man3/fopencookie.3:173
2456 #, no-wrap
2457 msgid "I<cookie_seek_function_t *seek>"
2458 msgstr ""
2459
2460 #. type: Plain text
2461 #: build/C/man3/fopencookie.3:177
2462 msgid ""
2463 "This function implements seek operations on the stream.  When called, it "
2464 "receives three arguments:"
2465 msgstr ""
2466
2467 #. type: Plain text
2468 #: build/C/man3/fopencookie.3:179
2469 #, no-wrap
2470 msgid "    int seek(void *cookie, off64_t *offset, int whence);\n"
2471 msgstr ""
2472
2473 #. type: Plain text
2474 #: build/C/man3/fopencookie.3:185
2475 msgid ""
2476 "The I<*offset> argument specifies the new file offset depending on which of "
2477 "the following three values is supplied in I<whence>:"
2478 msgstr ""
2479
2480 #. type: TP
2481 #: build/C/man3/fopencookie.3:186 build/C/man2/lseek.2:67
2482 #, no-wrap
2483 msgid "B<SEEK_SET>"
2484 msgstr ""
2485
2486 #. type: Plain text
2487 #: build/C/man3/fopencookie.3:191
2488 msgid ""
2489 "The stream offset should be set I<*offset> bytes from the start of the "
2490 "stream."
2491 msgstr ""
2492
2493 #. type: TP
2494 #: build/C/man3/fopencookie.3:191 build/C/man2/lseek.2:72
2495 #, no-wrap
2496 msgid "B<SEEK_CUR>"
2497 msgstr ""
2498
2499 #. type: Plain text
2500 #: build/C/man3/fopencookie.3:195
2501 msgid "I<*offset> should be added to the current stream offset."
2502 msgstr ""
2503
2504 #. type: TP
2505 #: build/C/man3/fopencookie.3:195 build/C/man2/lseek.2:77
2506 #, no-wrap
2507 msgid "B<SEEK_END>"
2508 msgstr ""
2509
2510 #. type: Plain text
2511 #: build/C/man3/fopencookie.3:199
2512 msgid "The stream offset should be set to the size of the stream plus I<*offset>."
2513 msgstr ""
2514
2515 #. type: Plain text
2516 #: build/C/man3/fopencookie.3:206
2517 msgid ""
2518 "Before returning, the I<seek> function should update I<*offset> to indicate "
2519 "the new stream offset."
2520 msgstr ""
2521
2522 #. type: Plain text
2523 #: build/C/man3/fopencookie.3:210
2524 msgid ""
2525 "As its function result, the I<seek> function should return 0 on success, and "
2526 "-1 on error."
2527 msgstr ""
2528
2529 #. type: Plain text
2530 #: build/C/man3/fopencookie.3:215
2531 msgid ""
2532 "If I<*seek> is a NULL pointer, then it is not possible to perform seek "
2533 "operations on the stream."
2534 msgstr ""
2535
2536 #. type: TP
2537 #: build/C/man3/fopencookie.3:215
2538 #, no-wrap
2539 msgid "I<cookie_close_function_t *close>"
2540 msgstr ""
2541
2542 #. type: Plain text
2543 #: build/C/man3/fopencookie.3:221
2544 msgid ""
2545 "This function closes the stream.  The hook function can do things such as "
2546 "freeing buffers allocated for the stream.  When called, it receives one "
2547 "argument:"
2548 msgstr ""
2549
2550 #. type: Plain text
2551 #: build/C/man3/fopencookie.3:223
2552 #, no-wrap
2553 msgid "    int close(void *cookie);\n"
2554 msgstr ""
2555
2556 #. type: Plain text
2557 #: build/C/man3/fopencookie.3:228
2558 msgid ""
2559 "The I<cookie> argument is the cookie that the programmer supplied when "
2560 "calling B<fopencookie>()."
2561 msgstr ""
2562
2563 #. type: Plain text
2564 #: build/C/man3/fopencookie.3:234
2565 msgid ""
2566 "As its function result, the I<close> function should return 0 on success, "
2567 "and B<EOF> on error."
2568 msgstr ""
2569
2570 #. type: Plain text
2571 #: build/C/man3/fopencookie.3:238
2572 msgid ""
2573 "If I<*close> is NULL, then no special action is performed when the stream is "
2574 "closed."
2575 msgstr ""
2576
2577 #.  .SH ERRORS
2578 #.  It's not clear if errno ever gets set...
2579 #. type: Plain text
2580 #: build/C/man3/fopencookie.3:245
2581 msgid ""
2582 "On success B<fopencookie>()  returns a pointer to the new stream.  On error, "
2583 "NULL is returned."
2584 msgstr ""
2585
2586 #. type: Plain text
2587 #: build/C/man3/fopencookie.3:247
2588 msgid "This function is a nonstandard GNU extension."
2589 msgstr ""
2590
2591 #. type: Plain text
2592 #: build/C/man3/fopencookie.3:256
2593 msgid ""
2594 "The program below implements a custom stream whose functionality is similar "
2595 "(but not identical) to that available via B<fmemopen>(3).  It implements a "
2596 "stream whose data is stored in a memory buffer.  The program writes its "
2597 "command-line arguments to the stream, and then seeks through the stream "
2598 "reading two out of every five characters and writing them to standard "
2599 "output.  The following shell session demonstrates the use of the program:"
2600 msgstr ""
2601
2602 #. type: Plain text
2603 #: build/C/man3/fopencookie.3:264
2604 #, no-wrap
2605 msgid ""
2606 "$B< ./a.out \\(aqhello world\\(aq>\n"
2607 "/he/\n"
2608 "/ w/\n"
2609 "/d/\n"
2610 "Reached end of file\n"
2611 msgstr ""
2612
2613 #. type: Plain text
2614 #: build/C/man3/fopencookie.3:271
2615 msgid ""
2616 "Note that a more general version of the program below could be improved to "
2617 "more robustly handle various error situations (e.g., opening a stream with a "
2618 "cookie that already has an open stream; closing a stream that has already "
2619 "been closed)."
2620 msgstr ""
2621
2622 #. type: Plain text
2623 #: build/C/man3/fopencookie.3:280
2624 #, no-wrap
2625 msgid ""
2626 "#define _GNU_SOURCE\n"
2627 "#include E<lt>sys/types.hE<gt>\n"
2628 "#include E<lt>stdio.hE<gt>\n"
2629 "#include E<lt>stdlib.hE<gt>\n"
2630 "#include E<lt>unistd.hE<gt>\n"
2631 "#include E<lt>string.hE<gt>\n"
2632 msgstr ""
2633
2634 #. type: Plain text
2635 #: build/C/man3/fopencookie.3:282
2636 #, no-wrap
2637 msgid "#define INIT_BUF_SIZE 4\n"
2638 msgstr ""
2639
2640 #. type: Plain text
2641 #: build/C/man3/fopencookie.3:289
2642 #, no-wrap
2643 msgid ""
2644 "struct memfile_cookie {\n"
2645 "    char   *buf;        /* Dynamically sized buffer for data */\n"
2646 "    size_t  allocated;  /* Size of buf */\n"
2647 "    size_t  endpos;     /* Number of characters in buf */\n"
2648 "    off_t   offset;     /* Current file offset in buf */\n"
2649 "};\n"
2650 msgstr ""
2651
2652 #. type: Plain text
2653 #: build/C/man3/fopencookie.3:295
2654 #, no-wrap
2655 msgid ""
2656 "ssize_t\n"
2657 "memfile_write(void *c, const char *buf, size_t size)\n"
2658 "{\n"
2659 "    char *new_buff;\n"
2660 "    struct memfile_cookie *cookie = c;\n"
2661 msgstr ""
2662
2663 #. type: Plain text
2664 #: build/C/man3/fopencookie.3:297
2665 #, no-wrap
2666 msgid "    /* Buffer too small? Keep doubling size until big enough */\n"
2667 msgstr ""
2668
2669 #. type: Plain text
2670 #: build/C/man3/fopencookie.3:307
2671 #, no-wrap
2672 msgid ""
2673 "    while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
2674 "        new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
2675 "        if (new_buff == NULL) {\n"
2676 "            return -1;\n"
2677 "        } else {\n"
2678 "            cookie-E<gt>allocated *= 2;\n"
2679 "            cookie-E<gt>buf = new_buff;\n"
2680 "        }\n"
2681 "    }\n"
2682 msgstr ""
2683
2684 #. type: Plain text
2685 #: build/C/man3/fopencookie.3:309
2686 #, no-wrap
2687 msgid "    memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
2688 msgstr ""
2689
2690 #. type: Plain text
2691 #: build/C/man3/fopencookie.3:313
2692 #, no-wrap
2693 msgid ""
2694 "    cookie-E<gt>offset += size;\n"
2695 "    if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
2696 "        cookie-E<gt>endpos = cookie-E<gt>offset;\n"
2697 msgstr ""
2698
2699 #. type: Plain text
2700 #: build/C/man3/fopencookie.3:316
2701 #, no-wrap
2702 msgid ""
2703 "    return size;\n"
2704 "}\n"
2705 msgstr ""
2706
2707 #. type: Plain text
2708 #: build/C/man3/fopencookie.3:322
2709 #, no-wrap
2710 msgid ""
2711 "ssize_t\n"
2712 "memfile_read(void *c, char *buf, size_t size)\n"
2713 "{\n"
2714 "    ssize_t xbytes;\n"
2715 "    struct memfile_cookie *cookie = c;\n"
2716 msgstr ""
2717
2718 #. type: Plain text
2719 #: build/C/man3/fopencookie.3:324
2720 #, no-wrap
2721 msgid "    /* Fetch minimum of bytes requested and bytes available */\n"
2722 msgstr ""
2723
2724 #. type: Plain text
2725 #: build/C/man3/fopencookie.3:330
2726 #, no-wrap
2727 msgid ""
2728 "    xbytes = size;\n"
2729 "    if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
2730 "        xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
2731 "    if (xbytes E<lt> 0)     /* offset may be past endpos */\n"
2732 "       xbytes = 0;\n"
2733 msgstr ""
2734
2735 #. type: Plain text
2736 #: build/C/man3/fopencookie.3:332
2737 #, no-wrap
2738 msgid "    memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
2739 msgstr ""
2740
2741 #. type: Plain text
2742 #: build/C/man3/fopencookie.3:336
2743 #, no-wrap
2744 msgid ""
2745 "    cookie-E<gt>offset += xbytes;\n"
2746 "    return xbytes;\n"
2747 "}\n"
2748 msgstr ""
2749
2750 #. type: Plain text
2751 #: build/C/man3/fopencookie.3:342
2752 #, no-wrap
2753 msgid ""
2754 "int\n"
2755 "memfile_seek(void *c, off64_t *offset, int whence)\n"
2756 "{\n"
2757 "    off64_t new_offset;\n"
2758 "    struct memfile_cookie *cookie = c;\n"
2759 msgstr ""
2760
2761 #. type: Plain text
2762 #: build/C/man3/fopencookie.3:351
2763 #, no-wrap
2764 msgid ""
2765 "    if (whence == SEEK_SET)\n"
2766 "        new_offset = *offset;\n"
2767 "    else if (whence == SEEK_END)\n"
2768 "        new_offset = cookie-E<gt>endpos + *offset;\n"
2769 "    else if (whence == SEEK_CUR)\n"
2770 "        new_offset = cookie-E<gt>offset + *offset;\n"
2771 "    else\n"
2772 "        return -1;\n"
2773 msgstr ""
2774
2775 #. type: Plain text
2776 #: build/C/man3/fopencookie.3:354
2777 #, no-wrap
2778 msgid ""
2779 "    if (new_offset E<lt> 0)\n"
2780 "        return -1;\n"
2781 msgstr ""
2782
2783 #. type: Plain text
2784 #: build/C/man3/fopencookie.3:359
2785 #, no-wrap
2786 msgid ""
2787 "    cookie-E<gt>offset = new_offset;\n"
2788 "    *offset = new_offset;\n"
2789 "    return 0;\n"
2790 "}\n"
2791 msgstr ""
2792
2793 #. type: Plain text
2794 #: build/C/man3/fopencookie.3:364
2795 #, no-wrap
2796 msgid ""
2797 "int\n"
2798 "memfile_close(void *c)\n"
2799 "{\n"
2800 "    struct memfile_cookie *cookie = c;\n"
2801 msgstr ""
2802
2803 #. type: Plain text
2804 #: build/C/man3/fopencookie.3:368
2805 #, no-wrap
2806 msgid ""
2807 "    free(cookie-E<gt>buf);\n"
2808 "    cookie-E<gt>allocated = 0;\n"
2809 "    cookie-E<gt>buf = NULL;\n"
2810 msgstr ""
2811
2812 #. type: Plain text
2813 #: build/C/man3/fopencookie.3:371
2814 #, no-wrap
2815 msgid ""
2816 "    return 0;\n"
2817 "}\n"
2818 msgstr ""
2819
2820 #. type: Plain text
2821 #: build/C/man3/fopencookie.3:387
2822 #, no-wrap
2823 msgid ""
2824 "int\n"
2825 "main(int argc, char *argv[])\n"
2826 "{\n"
2827 "    cookie_io_functions_t  memfile_func = {\n"
2828 "        .read  = memfile_read,\n"
2829 "        .write = memfile_write,\n"
2830 "        .seek  = memfile_seek,\n"
2831 "        .close = memfile_close\n"
2832 "    };\n"
2833 "    FILE *fp;\n"
2834 "    struct memfile_cookie mycookie;\n"
2835 "    ssize_t nread;\n"
2836 "    long p;\n"
2837 "    int j;\n"
2838 "    char buf[1000];\n"
2839 msgstr ""
2840
2841 #. type: Plain text
2842 #: build/C/man3/fopencookie.3:389
2843 #, no-wrap
2844 msgid "    /* Set up the cookie before calling fopencookie() */\n"
2845 msgstr ""
2846
2847 #. type: Plain text
2848 #: build/C/man3/fopencookie.3:395
2849 #, no-wrap
2850 msgid ""
2851 "    mycookie.buf = malloc(INIT_BUF_SIZE);\n"
2852 "    if (mycookie.buf == NULL) {\n"
2853 "        perror(\"malloc\");\n"
2854 "        exit(EXIT_FAILURE);\n"
2855 "    }\n"
2856 msgstr ""
2857
2858 #. type: Plain text
2859 #: build/C/man3/fopencookie.3:399
2860 #, no-wrap
2861 msgid ""
2862 "    mycookie.allocated = INIT_BUF_SIZE;\n"
2863 "    mycookie.offset = 0;\n"
2864 "    mycookie.endpos = 0;\n"
2865 msgstr ""
2866
2867 #. type: Plain text
2868 #: build/C/man3/fopencookie.3:405
2869 #, no-wrap
2870 msgid ""
2871 "    fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
2872 "    if (fp == NULL) {\n"
2873 "        perror(\"fopencookie\");\n"
2874 "        exit(EXIT_FAILURE);\n"
2875 "    }\n"
2876 msgstr ""
2877
2878 #. type: Plain text
2879 #: build/C/man3/fopencookie.3:407
2880 #, no-wrap
2881 msgid "    /* Write command-line arguments to our file */\n"
2882 msgstr ""
2883
2884 #. type: Plain text
2885 #: build/C/man3/fopencookie.3:413
2886 #, no-wrap
2887 msgid ""
2888 "    for (j = 1; j E<lt> argc; j++)\n"
2889 "        if (fputs(argv[j], fp) == EOF) {\n"
2890 "            perror(\"fputs\");\n"
2891 "            exit(EXIT_FAILURE);\n"
2892 "        }\n"
2893 msgstr ""
2894
2895 #. type: Plain text
2896 #: build/C/man3/fopencookie.3:415
2897 #, no-wrap
2898 msgid "    /* Read two bytes out of every five, until EOF */\n"
2899 msgstr ""
2900
2901 #. type: Plain text
2902 #: build/C/man3/fopencookie.3:430
2903 #, no-wrap
2904 msgid ""
2905 "    for (p = 0; ; p += 5) {\n"
2906 "        if (fseek(fp, p, SEEK_SET) == -1) {\n"
2907 "            perror(\"fseek\");\n"
2908 "            exit(EXIT_FAILURE);\n"
2909 "        }\n"
2910 "        nread = fread(buf, 1, 2, fp);\n"
2911 "        if (nread == -1) {\n"
2912 "            perror(\"fread\");\n"
2913 "            exit(EXIT_FAILURE);\n"
2914 "        }\n"
2915 "        if (nread == 0) {\n"
2916 "            printf(\"Reached end of file\\en\");\n"
2917 "            break;\n"
2918 "        }\n"
2919 msgstr ""
2920
2921 #. type: Plain text
2922 #: build/C/man3/fopencookie.3:433
2923 #, no-wrap
2924 msgid ""
2925 "        printf(\"/%.*s/\\en\", nread, buf);\n"
2926 "    }\n"
2927 msgstr ""
2928
2929 #. type: Plain text
2930 #: build/C/man3/fopencookie.3:436 build/C/man2/readlink.2:213
2931 #, no-wrap
2932 msgid ""
2933 "    exit(EXIT_SUCCESS);\n"
2934 "}\n"
2935 msgstr ""
2936
2937 #. type: Plain text
2938 #: build/C/man3/fopencookie.3:442
2939 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
2940 msgstr ""
2941
2942 #. type: TH
2943 #: build/C/man3/fpurge.3:25
2944 #, no-wrap
2945 msgid "FPURGE"
2946 msgstr ""
2947
2948 #. type: TH
2949 #: build/C/man3/fpurge.3:25
2950 #, no-wrap
2951 msgid "2001-12-15"
2952 msgstr ""
2953
2954 #. type: Plain text
2955 #: build/C/man3/fpurge.3:28
2956 msgid "fpurge, __fpurge - purge a stream"
2957 msgstr ""
2958
2959 #. type: Plain text
2960 #: build/C/man3/fpurge.3:32
2961 #, no-wrap
2962 msgid ""
2963 "/* unsupported */\n"
2964 "B<#include E<lt>stdio.hE<gt>>\n"
2965 msgstr ""
2966
2967 #. type: Plain text
2968 #: build/C/man3/fpurge.3:34
2969 #, no-wrap
2970 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
2971 msgstr ""
2972
2973 #. type: Plain text
2974 #: build/C/man3/fpurge.3:37
2975 #, no-wrap
2976 msgid ""
2977 "/* supported */\n"
2978 "B<#include E<lt>stdio.hE<gt>>\n"
2979 msgstr ""
2980
2981 #. type: Plain text
2982 #: build/C/man3/fpurge.3:39
2983 #, no-wrap
2984 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
2985 msgstr ""
2986
2987 #. type: Plain text
2988 #: build/C/man3/fpurge.3:41
2989 #, no-wrap
2990 msgid "B<void  __fpurge(FILE *>I<stream>B<);>\n"
2991 msgstr ""
2992
2993 #. type: Plain text
2994 #: build/C/man3/fpurge.3:54
2995 msgid ""
2996 "The function B<fpurge>()  clears the buffers of the given stream.  For "
2997 "output streams this discards any unwritten output.  For input streams this "
2998 "discards any input read from the underlying object but not yet obtained via "
2999 "B<getc>(3); this includes any text pushed back via B<ungetc>(3).  See also "
3000 "B<fflush>(3)."
3001 msgstr ""
3002
3003 #. type: Plain text
3004 #: build/C/man3/fpurge.3:58
3005 msgid ""
3006 "The function B<__fpurge>()  does precisely the same, but without returning a "
3007 "value."
3008 msgstr ""
3009
3010 #. type: Plain text
3011 #: build/C/man3/fpurge.3:65
3012 msgid ""
3013 "Upon successful completion B<fpurge>()  returns 0.  On error, it returns -1 "
3014 "and sets I<errno> appropriately."
3015 msgstr ""
3016
3017 #. type: Plain text
3018 #: build/C/man3/fpurge.3:70
3019 msgid "I<stream> is not an open stream."
3020 msgstr ""
3021
3022 #. type: Plain text
3023 #: build/C/man3/fpurge.3:78
3024 msgid ""
3025 "These functions are nonstandard and not portable.  The function B<fpurge>()  "
3026 "was introduced in 4.4BSD and is not available under Linux.  The function "
3027 "B<__fpurge>()  was introduced in Solaris, and is present in glibc 2.1.95 and "
3028 "later."
3029 msgstr ""
3030
3031 #. type: Plain text
3032 #: build/C/man3/fpurge.3:80
3033 msgid "Usually it is a mistake to want to discard input buffers."
3034 msgstr ""
3035
3036 #.  .BR fclean (3),
3037 #. type: Plain text
3038 #: build/C/man3/fpurge.3:85
3039 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
3040 msgstr ""
3041
3042 #. type: TH
3043 #: build/C/man3/fputwc.3:16
3044 #, no-wrap
3045 msgid "FPUTWC"
3046 msgstr ""
3047
3048 #. type: Plain text
3049 #: build/C/man3/fputwc.3:19
3050 msgid "fputwc, putwc - write a wide character to a FILE stream"
3051 msgstr ""
3052
3053 #. type: Plain text
3054 #: build/C/man3/fputwc.3:27
3055 #, no-wrap
3056 msgid ""
3057 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
3058 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
3059 msgstr ""
3060
3061 #. type: Plain text
3062 #: build/C/man3/fputwc.3:43
3063 msgid ""
3064 "The B<fputwc>()  function is the wide-character equivalent of the "
3065 "B<fputc>(3)  function.  It writes the wide character I<wc> to I<stream>.  If "
3066 "I<ferror(stream)> becomes true, it returns B<WEOF>.  If a wide-character "
3067 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>.  "
3068 "Otherwise it returns I<wc>."
3069 msgstr ""
3070
3071 #. type: Plain text
3072 #: build/C/man3/fputwc.3:51
3073 msgid ""
3074 "The B<putwc>()  function or macro functions identically to B<fputwc>().  It "
3075 "may be implemented as a macro, and may evaluate its argument more than "
3076 "once.  There is no reason ever to use it."
3077 msgstr ""
3078
3079 #. type: Plain text
3080 #: build/C/man3/fputwc.3:63
3081 msgid ""
3082 "The B<fputwc>()  function returns I<wc> if no error occurred, or B<WEOF> to "
3083 "indicate an error.  In the event of an error, I<errno> is set to indicate "
3084 "the cause."
3085 msgstr ""
3086
3087 #. type: Plain text
3088 #: build/C/man3/fputwc.3:68
3089 msgid "Conversion of I<wc> to the stream's encoding fails."
3090 msgstr ""
3091
3092 #. type: Plain text
3093 #: build/C/man3/fputwc.3:77
3094 msgid ""
3095 "The behavior of B<fputwc>()  depends on the B<LC_CTYPE> category of the "
3096 "current locale."
3097 msgstr ""
3098
3099 #. type: Plain text
3100 #: build/C/man3/fputwc.3:85
3101 msgid ""
3102 "In the absence of additional information passed to the B<fopen>(3)  call, it "
3103 "is reasonable to expect that B<fputwc>()  will actually write the multibyte "
3104 "sequence corresponding to the wide character I<wc>."
3105 msgstr ""
3106
3107 #. type: Plain text
3108 #: build/C/man3/fputwc.3:89
3109 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
3110 msgstr ""
3111
3112 #. type: TH
3113 #: build/C/man3/fread.3:45
3114 #, no-wrap
3115 msgid "FREAD"
3116 msgstr ""
3117
3118 #. type: TH
3119 #: build/C/man3/fread.3:45
3120 #, no-wrap
3121 msgid "2012-03-30"
3122 msgstr ""
3123
3124 #. type: Plain text
3125 #: build/C/man3/fread.3:48
3126 msgid "fread, fwrite - binary stream input/output"
3127 msgstr ""
3128
3129 #. type: Plain text
3130 #: build/C/man3/fread.3:54
3131 #, no-wrap
3132 msgid ""
3133 "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE "
3134 "*>I<stream>B<);>\n"
3135 msgstr ""
3136
3137 #. type: Plain text
3138 #: build/C/man3/fread.3:57
3139 #, no-wrap
3140 msgid ""
3141 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
3142 ">I<nmemb>B<,>\n"
3143 "B<              FILE *>I<stream>B<);>\n"
3144 msgstr ""
3145
3146 #. type: Plain text
3147 #: build/C/man3/fread.3:69
3148 msgid ""
3149 "The function B<fread>()  reads I<nmemb> elements of data, each I<size> bytes "
3150 "long, from the stream pointed to by I<stream>, storing them at the location "
3151 "given by I<ptr>."
3152 msgstr ""
3153
3154 #. type: Plain text
3155 #: build/C/man3/fread.3:80
3156 msgid ""
3157 "The function B<fwrite>()  writes I<nmemb> elements of data, each I<size> "
3158 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
3159 "location given by I<ptr>."
3160 msgstr ""
3161
3162 #. type: Plain text
3163 #: build/C/man3/fread.3:96
3164 msgid ""
3165 "On success, B<fread>()  and B<fwrite>()  return the number of I<items> read "
3166 "or written.  This number equals the number of bytes transferred only when "
3167 "I<size> is 1.  If an error occurs, or the end of the file is reached, the "
3168 "return value is a short item count (or zero)."
3169 msgstr ""
3170
3171 #. type: Plain text
3172 #: build/C/man3/fread.3:103
3173 msgid ""
3174 "B<fread>()  does not distinguish between end-of-file and error, and callers "
3175 "must use B<feof>(3)  and B<ferror>(3)  to determine which occurred."
3176 msgstr ""
3177
3178 #. type: Plain text
3179 #: build/C/man3/fread.3:105
3180 msgid "C89, POSIX.1-2001."
3181 msgstr ""
3182
3183 #. type: Plain text
3184 #: build/C/man3/fread.3:111
3185 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
3186 msgstr ""
3187
3188 #. type: TH
3189 #: build/C/man3/fseek.3:42
3190 #, no-wrap
3191 msgid "FSEEK"
3192 msgstr ""
3193
3194 #. type: TH
3195 #: build/C/man3/fseek.3:42
3196 #, no-wrap
3197 msgid "1993-11-29"
3198 msgstr ""
3199
3200 #. type: Plain text
3201 #: build/C/man3/fseek.3:45
3202 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
3203 msgstr ""
3204
3205 #. type: Plain text
3206 #: build/C/man3/fseek.3:49
3207 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
3208 msgstr ""
3209
3210 #. type: Plain text
3211 #: build/C/man3/fseek.3:51
3212 msgid "B<long ftell(FILE *>I<stream>B<);>"
3213 msgstr ""
3214
3215 #. type: Plain text
3216 #: build/C/man3/fseek.3:53
3217 msgid "B<void rewind(FILE *>I<stream>B<);>"
3218 msgstr ""
3219
3220 #. type: Plain text
3221 #: build/C/man3/fseek.3:55
3222 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3223 msgstr ""
3224
3225 #. type: Plain text
3226 #: build/C/man3/fseek.3:57
3227 msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3228 msgstr ""
3229
3230 #. type: Plain text
3231 #: build/C/man3/fseek.3:81
3232 msgid ""
3233 "The B<fseek>()  function sets the file position indicator for the stream "
3234 "pointed to by I<stream>.  The new position, measured in bytes, is obtained "
3235 "by adding I<offset> bytes to the position specified by I<whence>.  If "
3236 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
3237 "relative to the start of the file, the current position indicator, or "
3238 "end-of-file, respectively.  A successful call to the B<fseek>()  function "
3239 "clears the end-of-file indicator for the stream and undoes any effects of "
3240 "the B<ungetc>(3)  function on the same stream."
3241 msgstr ""
3242
3243 #. type: Plain text
3244 #: build/C/man3/fseek.3:87
3245 msgid ""
3246 "The B<ftell>()  function obtains the current value of the file position "
3247 "indicator for the stream pointed to by I<stream>."
3248 msgstr ""
3249
3250 #. type: Plain text
3251 #: build/C/man3/fseek.3:94
3252 msgid ""
3253 "The B<rewind>()  function sets the file position indicator for the stream "
3254 "pointed to by I<stream> to the beginning of the file.  It is equivalent to:"
3255 msgstr ""
3256
3257 #. type: Plain text
3258 #: build/C/man3/fseek.3:97
3259 msgid "(void) fseek(stream, 0L, SEEK_SET)"
3260 msgstr ""
3261
3262 #. type: Plain text
3263 #: build/C/man3/fseek.3:101
3264 msgid ""
3265 "except that the error indicator for the stream is also cleared (see "
3266 "B<clearerr>(3))."
3267 msgstr ""
3268
3269 #. type: Plain text
3270 #: build/C/man3/fseek.3:121
3271 msgid ""
3272 "The B<fgetpos>()  and B<fsetpos>()  functions are alternate interfaces "
3273 "equivalent to B<ftell>()  and B<fseek>()  (with I<whence> set to "
3274 "B<SEEK_SET>), setting and storing the current value of the file offset into "
3275 "or from the object referenced by I<pos>.  On some non-UNIX systems, an "
3276 "I<fpos_t> object may be a complex object and these routines may be the only "
3277 "way to portably reposition a text stream."
3278 msgstr ""
3279
3280 #. type: Plain text
3281 #: build/C/man3/fseek.3:136
3282 msgid ""
3283 "The B<rewind>()  function returns no value.  Upon successful completion, "
3284 "B<fgetpos>(), B<fseek>(), B<fsetpos>()  return 0, and B<ftell>()  returns "
3285 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3286 "indicate the error."
3287 msgstr ""
3288
3289 #. type: Plain text
3290 #: build/C/man3/fseek.3:142
3291 msgid "The I<stream> specified is not a seekable stream."
3292 msgstr ""
3293
3294 #. type: Plain text
3295 #: build/C/man3/fseek.3:153
3296 msgid ""
3297 "The I<whence> argument to B<fseek>()  was not B<SEEK_SET>, B<SEEK_END>, or "
3298 "B<SEEK_CUR>."
3299 msgstr ""
3300
3301 #. type: Plain text
3302 #: build/C/man3/fseek.3:168
3303 msgid ""
3304 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>()  may "
3305 "also fail and set I<errno> for any of the errors specified for the routines "
3306 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
3307 msgstr ""
3308
3309 #. type: Plain text
3310 #: build/C/man3/fseek.3:173
3311 msgid "B<lseek>(2), B<fseeko>(3)"
3312 msgstr ""
3313
3314 #. type: TH
3315 #: build/C/man3/fseeko.3:25
3316 #, no-wrap
3317 msgid "FSEEKO"
3318 msgstr ""
3319
3320 #. type: TH
3321 #: build/C/man3/fseeko.3:25
3322 #, no-wrap
3323 msgid "2001-11-05"
3324 msgstr ""
3325
3326 #. type: Plain text
3327 #: build/C/man3/fseeko.3:28
3328 msgid "fseeko, ftello - seek to or report file position"
3329 msgstr ""
3330
3331 #. type: Plain text
3332 #: build/C/man3/fseeko.3:33
3333 #, no-wrap
3334 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
3335 msgstr ""
3336
3337 #. type: Plain text
3338 #: build/C/man3/fseeko.3:36
3339 #, no-wrap
3340 msgid ""
3341 "B<off_t ftello(FILE *>I<stream>B<);>\n"
3342 "\n"
3343 msgstr ""
3344
3345 #. type: Plain text
3346 #: build/C/man3/fseeko.3:58
3347 msgid ""
3348 "The B<fseeko>()  and B<ftello>()  functions are identical to B<fseek>(3)  "
3349 "and B<ftell>(3)  (see B<fseek>(3)), respectively, except that the I<offset> "
3350 "argument of B<fseeko>()  and the return value of B<ftello>()  is of type "
3351 "I<off_t> instead of I<long>."
3352 msgstr ""
3353
3354 #. type: Plain text
3355 #: build/C/man3/fseeko.3:65
3356 msgid ""
3357 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
3358 "compilation with"
3359 msgstr ""
3360
3361 #. type: Plain text
3362 #: build/C/man3/fseeko.3:69 build/C/man3/lseek64.3:81
3363 #, no-wrap
3364 msgid "#define _FILE_OFFSET_BITS 64\n"
3365 msgstr ""
3366
3367 #. type: Plain text
3368 #: build/C/man3/fseeko.3:75
3369 msgid "will turn I<off_t> into a 64-bit type."
3370 msgstr ""
3371
3372 #. type: Plain text
3373 #: build/C/man3/fseeko.3:84
3374 msgid ""
3375 "On successful completion, B<fseeko>()  returns 0, while B<ftello>()  returns "
3376 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3377 "indicate the error."
3378 msgstr ""
3379
3380 #. type: Plain text
3381 #: build/C/man3/fseeko.3:87
3382 msgid "See the ERRORS in B<fseek>(3)."
3383 msgstr ""
3384
3385 #. type: Plain text
3386 #: build/C/man3/fseeko.3:89
3387 msgid "SUSv2, POSIX.1-2001."
3388 msgstr ""
3389
3390 #. type: Plain text
3391 #: build/C/man3/fseeko.3:93
3392 msgid ""
3393 "These functions are found on System V-like systems.  They are not present in "
3394 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
3395 msgstr ""
3396
3397 #. type: Plain text
3398 #: build/C/man3/fseeko.3:95
3399 msgid "B<fseek>(3)"
3400 msgstr ""
3401
3402 #. type: TH
3403 #: build/C/man3/getline.3:26
3404 #, no-wrap
3405 msgid "GETLINE"
3406 msgstr ""
3407
3408 #. type: Plain text
3409 #: build/C/man3/getline.3:29
3410 msgid "getline, getdelim - delimited string input"
3411 msgstr ""
3412
3413 #. type: Plain text
3414 #: build/C/man3/getline.3:34
3415 #, no-wrap
3416 msgid ""
3417 "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE "
3418 "*>I<stream>B<);>\n"
3419 msgstr ""
3420
3421 #. type: Plain text
3422 #: build/C/man3/getline.3:37
3423 #, no-wrap
3424 msgid ""
3425 "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, "
3426 "FILE *>I<stream>B<);>\n"
3427 msgstr ""
3428
3429 #. type: Plain text
3430 #: build/C/man3/getline.3:47
3431 msgid "B<getline>(), B<getdelim>():"
3432 msgstr ""
3433
3434 #. type: Plain text
3435 #: build/C/man3/getline.3:52
3436 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
3437 msgstr ""
3438
3439 #. type: Plain text
3440 #: build/C/man3/getline.3:65
3441 msgid ""
3442 "B<getline>()  reads an entire line from I<stream>, storing the address of "
3443 "the buffer containing the text into I<*lineptr>.  The buffer is "
3444 "null-terminated and includes the newline character, if one was found."
3445 msgstr ""
3446
3447 #. type: Plain text
3448 #: build/C/man3/getline.3:75
3449 msgid ""
3450 "If I<*lineptr> is NULL, then B<getline>()  will allocate a buffer for "
3451 "storing the line, which should be freed by the user program.  (In this case, "
3452 "the value in I<*n> is ignored.)"
3453 msgstr ""
3454
3455 #. type: Plain text
3456 #: build/C/man3/getline.3:93
3457 msgid ""
3458 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
3459 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size.  If the "
3460 "buffer is not large enough to hold the line, B<getline>()  resizes it with "
3461 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
3462 msgstr ""
3463
3464 #. type: Plain text
3465 #: build/C/man3/getline.3:99
3466 msgid ""
3467 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
3468 "to reflect the buffer address and allocated size respectively."
3469 msgstr ""
3470
3471 #. type: Plain text
3472 #: build/C/man3/getline.3:110
3473 msgid ""
3474 "B<getdelim>()  works like B<getline>(), except that a line delimiter other "
3475 "than newline can be specified as the I<delimiter> argument.  As with "
3476 "B<getline>(), a delimiter character is not added if one was not present in "
3477 "the input before end of file was reached."
3478 msgstr ""
3479
3480 #. type: Plain text
3481 #: build/C/man3/getline.3:119
3482 msgid ""
3483 "On success, B<getline>()  and B<getdelim>()  return the number of characters "
3484 "read, including the delimiter character, but not including the terminating "
3485 "null byte (\\(aq\\e0\\(aq).  This value can be used to handle embedded null "
3486 "bytes in the line read."
3487 msgstr ""
3488
3489 #. type: Plain text
3490 #: build/C/man3/getline.3:125
3491 msgid ""
3492 "Both functions return -1 on failure to read a line (including end-of-file "
3493 "condition).  In the event of an error, I<errno> is set to indicate the "
3494 "cause."
3495 msgstr ""
3496
3497 #. type: Plain text
3498 #: build/C/man3/getline.3:135
3499 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
3500 msgstr ""
3501
3502 #. type: Plain text
3503 #: build/C/man3/getline.3:137
3504 msgid "These functions are available since libc 4.6.27."
3505 msgstr ""
3506
3507 #. type: Plain text
3508 #: build/C/man3/getline.3:144
3509 msgid ""
3510 "Both B<getline>()  and B<getdelim>()  were originally GNU extensions.  They "
3511 "were standardized in POSIX.1-2008."
3512 msgstr ""
3513
3514 #. type: Plain text
3515 #: build/C/man3/getline.3:149
3516 #, no-wrap
3517 msgid ""
3518 "#define _GNU_SOURCE\n"
3519 "#include E<lt>stdio.hE<gt>\n"
3520 "#include E<lt>stdlib.hE<gt>\n"
3521 msgstr ""
3522
3523 #. type: Plain text
3524 #: build/C/man3/getline.3:157
3525 #, no-wrap
3526 msgid ""
3527 "int\n"
3528 "main(void)\n"
3529 "{\n"
3530 "    FILE *fp;\n"
3531 "    char *line = NULL;\n"
3532 "    size_t len = 0;\n"
3533 "    ssize_t read;\n"
3534 msgstr ""
3535
3536 #. type: Plain text
3537 #: build/C/man3/getline.3:161
3538 #, no-wrap
3539 msgid ""
3540 "    fp = fopen(\"/etc/motd\", \"r\");\n"
3541 "    if (fp == NULL)\n"
3542 "        exit(EXIT_FAILURE);\n"
3543 msgstr ""
3544
3545 #. type: Plain text
3546 #: build/C/man3/getline.3:166
3547 #, no-wrap
3548 msgid ""
3549 "    while ((read = getline(&line, &len, fp)) != -1) {\n"
3550 "        printf(\"Retrieved line of length %zu :\\en\", read);\n"
3551 "        printf(\"%s\", line);\n"
3552 "    }\n"
3553 msgstr ""
3554
3555 #. type: Plain text
3556 #: build/C/man3/getline.3:170
3557 #, no-wrap
3558 msgid ""
3559 "    free(line);\n"
3560 "    exit(EXIT_SUCCESS);\n"
3561 "}\n"
3562 msgstr ""
3563
3564 #. type: Plain text
3565 #: build/C/man3/getline.3:178
3566 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<gets>(3), B<scanf>(3)"
3567 msgstr ""
3568
3569 #. type: TH
3570 #: build/C/man3/gets.3:27
3571 #, no-wrap
3572 msgid "GETS"
3573 msgstr ""
3574
3575 #. type: TH
3576 #: build/C/man3/gets.3:27
3577 #, no-wrap
3578 msgid "2012-01-18"
3579 msgstr ""
3580
3581 #. type: Plain text
3582 #: build/C/man3/gets.3:30
3583 msgid "fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings"
3584 msgstr ""
3585
3586 #. type: Plain text
3587 #: build/C/man3/gets.3:35
3588 #, no-wrap
3589 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
3590 msgstr ""
3591
3592 #. type: Plain text
3593 #: build/C/man3/gets.3:37
3594 #, no-wrap
3595 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
3596 msgstr ""
3597
3598 #. type: Plain text
3599 #: build/C/man3/gets.3:39
3600 #, no-wrap
3601 msgid "B<int getc(FILE *>I<stream>B<);>\n"
3602 msgstr ""
3603
3604 #. type: Plain text
3605 #: build/C/man3/gets.3:41
3606 #, no-wrap
3607 msgid "B<int getchar(void);>\n"
3608 msgstr ""
3609
3610 #. type: Plain text
3611 #: build/C/man3/gets.3:43
3612 #, no-wrap
3613 msgid "B<char *gets(char *>I<s>B<);>\n"
3614 msgstr ""
3615
3616 #. type: Plain text
3617 #: build/C/man3/gets.3:45
3618 #, no-wrap
3619 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
3620 msgstr ""
3621
3622 #. type: Plain text
3623 #: build/C/man3/gets.3:57
3624 msgid ""
3625 "B<fgetc>()  reads the next character from I<stream> and returns it as an "
3626 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man3/gets.3:64
3631 msgid ""
3632 "B<getc>()  is equivalent to B<fgetc>()  except that it may be implemented as "
3633 "a macro which evaluates I<stream> more than once."
3634 msgstr ""
3635
3636 #. type: Plain text
3637 #: build/C/man3/gets.3:68
3638 msgid "B<getchar>()  is equivalent to B<getc(>I<stdin>B<)>."
3639 msgstr ""
3640
3641 #. type: Plain text
3642 #: build/C/man3/gets.3:78
3643 msgid ""
3644 "B<gets>()  reads a line from I<stdin> into the buffer pointed to by I<s> "
3645 "until either a terminating newline or B<EOF>, which it replaces with a null "
3646 "byte (\\(aq\\e0\\(aq).  No check for buffer overrun is performed (see BUGS "
3647 "below)."
3648 msgstr ""
3649
3650 #. type: Plain text
3651 #: build/C/man3/gets.3:92
3652 msgid ""
3653 "B<fgets>()  reads in at most one less than I<size> characters from I<stream> "
3654 "and stores them into the buffer pointed to by I<s>.  Reading stops after an "
3655 "B<EOF> or a newline.  If a newline is read, it is stored into the buffer.  A "
3656 "terminating null byte (\\(aq\\e0\\(aq)  is stored after the last character "
3657 "in the buffer."
3658 msgstr ""
3659
3660 #. type: Plain text
3661 #: build/C/man3/gets.3:103
3662 msgid ""
3663 "B<ungetc>()  pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
3664 "it is available for subsequent read operations.  Pushed-back characters will "
3665 "be returned in reverse order; only one pushback is guaranteed."
3666 msgstr ""
3667
3668 #. type: Plain text
3669 #: build/C/man3/gets.3:108
3670 msgid ""
3671 "Calls to the functions described here can be mixed with each other and with "
3672 "calls to other input functions from the I<stdio> library for the same input "
3673 "stream."
3674 msgstr ""
3675
3676 #. type: Plain text
3677 #: build/C/man3/gets.3:123
3678 msgid ""
3679 "B<fgetc>(), B<getc>()  and B<getchar>()  return the character read as an "
3680 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
3681 msgstr ""
3682
3683 #. type: Plain text
3684 #: build/C/man3/gets.3:131
3685 msgid ""
3686 "B<gets>()  and B<fgets>()  return I<s> on success, and NULL on error or when "
3687 "end of file occurs while no characters have been read."
3688 msgstr ""
3689
3690 #. type: Plain text
3691 #: build/C/man3/gets.3:138
3692 msgid "B<ungetc>()  returns I<c> on success, or B<EOF> on error."
3693 msgstr ""
3694
3695 #. type: Plain text
3696 #: build/C/man3/gets.3:140
3697 msgid "C89, C99, POSIX.1-2001."
3698 msgstr ""
3699
3700 #. type: Plain text
3701 #: build/C/man3/gets.3:152
3702 msgid ""
3703 "LSB deprecates B<gets>().  POSIX.1-2008 marks B<gets>()  obsolescent.  ISO "
3704 "C11 removes the specification of B<gets>()  from the C language, and since "
3705 "version 2.16, glibc header files don't expose the function declaration if "
3706 "the B<_ISOC11_SOURCE> feature test macro is defined."
3707 msgstr ""
3708
3709 #. type: Plain text
3710 #: build/C/man3/gets.3:166
3711 msgid ""
3712 "Never use B<gets>().  Because it is impossible to tell without knowing the "
3713 "data in advance how many characters B<gets>()  will read, and because "
3714 "B<gets>()  will continue to store characters past the end of the buffer, it "
3715 "is extremely dangerous to use.  It has been used to break computer "
3716 "security.  Use B<fgets>()  instead."
3717 msgstr ""
3718
3719 #. type: Plain text
3720 #: build/C/man3/gets.3:173
3721 msgid ""
3722 "It is not advisable to mix calls to input functions from the I<stdio> "
3723 "library with low-level calls to B<read>(2)  for the file descriptor "
3724 "associated with the input stream; the results will be undefined and very "
3725 "probably not what you want."
3726 msgstr ""
3727
3728 #. type: Plain text
3729 #: build/C/man3/gets.3:189
3730 msgid ""
3731 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
3732 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<getwchar>(3), "
3733 "B<puts>(3), B<scanf>(3), B<ungetwc>(3), B<unlocked_stdio>(3), "
3734 "B<feature_test_macros>(7)"
3735 msgstr ""
3736
3737 #. type: TH
3738 #: build/C/man3/getw.3:25
3739 #, no-wrap
3740 msgid "GETW"
3741 msgstr ""
3742
3743 #. type: TH
3744 #: build/C/man3/getw.3:25
3745 #, no-wrap
3746 msgid "2010-09-26"
3747 msgstr ""
3748
3749 #. type: Plain text
3750 #: build/C/man3/getw.3:28
3751 msgid "getw, putw - input and output of words (ints)"
3752 msgstr ""
3753
3754 #. type: Plain text
3755 #: build/C/man3/getw.3:33
3756 #, no-wrap
3757 msgid "B<int getw(FILE *>I<stream>B<);>\n"
3758 msgstr ""
3759
3760 #. type: Plain text
3761 #: build/C/man3/getw.3:35
3762 #, no-wrap
3763 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
3764 msgstr ""
3765
3766 #. type: Plain text
3767 #: build/C/man3/getw.3:44
3768 msgid "B<getw>(), B<putw>():"
3769 msgstr ""
3770
3771 #. type: TP
3772 #: build/C/man3/getw.3:47
3773 #, no-wrap
3774 msgid "Since glibc 2.3.3:"
3775 msgstr ""
3776
3777 #. type: Plain text
3778 #: build/C/man3/getw.3:50
3779 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
3780 msgstr ""
3781
3782 #. type: Plain text
3783 #: build/C/man3/getw.3:53
3784 #, no-wrap
3785 msgid ""
3786 "(_XOPEN_SOURCE &&\n"
3787 "    !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
3788 msgstr ""
3789
3790 #. type: TP
3791 #: build/C/man3/getw.3:53
3792 #, no-wrap
3793 msgid "Before glibc 2.3.3:"
3794 msgstr ""
3795
3796 #. type: Plain text
3797 #: build/C/man3/getw.3:56
3798 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
3799 msgstr ""
3800
3801 #. type: Plain text
3802 #: build/C/man3/getw.3:66
3803 msgid ""
3804 "B<getw>()  reads a word (that is, an I<int>) from I<stream>.  It's provided "
3805 "for compatibility with SVr4.  We recommend you use B<fread>(3)  instead."
3806 msgstr ""
3807
3808 #. type: Plain text
3809 #: build/C/man3/getw.3:73
3810 msgid ""
3811 "B<putw>()  writes the word I<w> (that is, an I<int>) to I<stream>.  It is "
3812 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3)  "
3813 "instead."
3814 msgstr ""
3815
3816 #. type: Plain text
3817 #: build/C/man3/getw.3:80
3818 msgid ""
3819 "Normally, B<getw>()  returns the word read, and B<putw>()  returns 0.  On "
3820 "error, they return B<EOF>."
3821 msgstr ""
3822
3823 #. type: Plain text
3824 #: build/C/man3/getw.3:82
3825 msgid "SVr4, SUSv2.  Not present in POSIX.1-2001."
3826 msgstr ""
3827
3828 #. type: Plain text
3829 #: build/C/man3/getw.3:86
3830 msgid ""
3831 "The value returned on error is also a legitimate data value.  B<ferror>(3)  "
3832 "can be used to distinguish between the two cases."
3833 msgstr ""
3834
3835 #. type: Plain text
3836 #: build/C/man3/getw.3:92
3837 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
3838 msgstr ""
3839
3840 #. type: TH
3841 #: build/C/man2/link.2:31
3842 #, no-wrap
3843 msgid "LINK"
3844 msgstr ""
3845
3846 #. type: TH
3847 #: build/C/man2/link.2:31 build/C/man2/rename.2:32 build/C/man2/symlink.2:32 build/C/man2/write.2:39
3848 #, no-wrap
3849 msgid "2013-01-27"
3850 msgstr ""
3851
3852 #. type: Plain text
3853 #: build/C/man2/link.2:34
3854 msgid "link - make a new name for a file"
3855 msgstr ""
3856
3857 #. type: Plain text
3858 #: build/C/man2/link.2:36 build/C/man2/lseek.2:54 build/C/man3/lseek64.3:34 build/C/man2/readlink.2:48 build/C/man2/rmdir.2:35 build/C/man2/symlink.2:37 build/C/man2/unlink.2:37 build/C/man2/write.2:44
3859 msgid "B<#include E<lt>unistd.hE<gt>>"
3860 msgstr ""
3861
3862 #. type: Plain text
3863 #: build/C/man2/link.2:38
3864 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
3865 msgstr ""
3866
3867 #. type: Plain text
3868 #: build/C/man2/link.2:41
3869 msgid ""
3870 "B<link>()  creates a new link (also known as a hard link) to an existing "
3871 "file."
3872 msgstr ""
3873
3874 #. type: Plain text
3875 #: build/C/man2/link.2:47 build/C/man2/symlink.2:84
3876 msgid "If I<newpath> exists it will I<not> be overwritten."
3877 msgstr ""
3878
3879 #. type: Plain text
3880 #: build/C/man2/link.2:52
3881 msgid ""
3882 "This new name may be used exactly as the old one for any operation; both "
3883 "names refer to the same file (and so have the same permissions and "
3884 "ownership) and it is impossible to tell which name was the \"original\"."
3885 msgstr ""
3886
3887 #. type: Plain text
3888 #: 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
3889 msgid ""
3890 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
3891 "appropriately."
3892 msgstr ""
3893
3894 #. type: TP
3895 #: build/C/man2/link.2:58 build/C/man2/open.2:576 build/C/man2/readlink.2:86 build/C/man2/rename.2:97 build/C/man2/rmdir.2:46 build/C/man2/symlink.2:90 build/C/man3/tmpfile.3:57 build/C/man2/unlink.2:61
3896 #, no-wrap
3897 msgid "B<EACCES>"
3898 msgstr ""
3899
3900 #. type: Plain text
3901 #: build/C/man2/link.2:69
3902 msgid ""
3903 "Write access to the directory containing I<newpath> is denied, or search "
3904 "permission is denied for one of the directories in the path prefix of "
3905 "I<oldpath> or I<newpath>.  (See also B<path_resolution>(7).)"
3906 msgstr ""
3907
3908 #. type: TP
3909 #: build/C/man2/link.2:69 build/C/man2/open.2:585 build/C/man2/rename.2:133 build/C/man2/symlink.2:99 build/C/man2/write.2:135
3910 #, no-wrap
3911 msgid "B<EDQUOT>"
3912 msgstr ""
3913
3914 #. type: Plain text
3915 #: build/C/man2/link.2:72 build/C/man2/rename.2:136
3916 msgid "The user's quota of disk blocks on the file system has been exhausted."
3917 msgstr ""
3918
3919 #. type: TP
3920 #: build/C/man2/link.2:72 build/C/man2/open.2:591 build/C/man2/symlink.2:104 build/C/man3/tmpfile.3:60
3921 #, no-wrap
3922 msgid "B<EEXIST>"
3923 msgstr ""
3924
3925 #. type: Plain text
3926 #: build/C/man2/link.2:76 build/C/man2/symlink.2:108
3927 msgid "I<newpath> already exists."
3928 msgstr ""
3929
3930 #. type: TP
3931 #: build/C/man2/link.2:76 build/C/man2/llseek.2:74 build/C/man2/open.2:597 build/C/man2/pipe.2:98 build/C/man2/read.2:118 build/C/man2/readlink.2:91 build/C/man2/rename.2:136 build/C/man2/rmdir.2:64 build/C/man2/symlink.2:108 build/C/man2/unlink.2:80 build/C/man2/write.2:141
3932 #, no-wrap
3933 msgid "B<EFAULT>"
3934 msgstr ""
3935
3936 #. type: Plain text
3937 #: build/C/man2/link.2:79 build/C/man2/rename.2:139 build/C/man2/symlink.2:111
3938 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
3939 msgstr ""
3940
3941 #. type: TP
3942 #: build/C/man2/link.2:79 build/C/man2/read.2:147 build/C/man2/readlink.2:107 build/C/man2/symlink.2:111 build/C/man2/unlink.2:84 build/C/man2/write.2:165
3943 #, no-wrap
3944 msgid "B<EIO>"
3945 msgstr ""
3946
3947 #. type: Plain text
3948 #: build/C/man2/link.2:82 build/C/man2/symlink.2:114 build/C/man2/unlink.2:87
3949 msgid "An I/O error occurred."
3950 msgstr ""
3951
3952 #. type: TP
3953 #: build/C/man2/link.2:82 build/C/man2/open.2:621 build/C/man2/readlink.2:110 build/C/man2/rename.2:149 build/C/man2/rmdir.2:73 build/C/man2/symlink.2:114 build/C/man2/unlink.2:92
3954 #, no-wrap
3955 msgid "B<ELOOP>"
3956 msgstr ""
3957
3958 #. type: Plain text
3959 #: build/C/man2/link.2:86 build/C/man2/rename.2:153
3960 msgid ""
3961 "Too many symbolic links were encountered in resolving I<oldpath> or "
3962 "I<newpath>."
3963 msgstr ""
3964
3965 #. type: TP
3966 #: build/C/man2/link.2:86 build/C/man2/rename.2:153
3967 #, no-wrap
3968 msgid "B<EMLINK>"
3969 msgstr ""
3970
3971 #. type: Plain text
3972 #: build/C/man2/link.2:91
3973 msgid ""
3974 "The file referred to by I<oldpath> already has the maximum number of links "
3975 "to it."
3976 msgstr ""
3977
3978 #. type: TP
3979 #: build/C/man2/link.2:91 build/C/man2/open.2:631 build/C/man2/readlink.2:113 build/C/man2/rename.2:160 build/C/man2/rmdir.2:77 build/C/man2/symlink.2:118 build/C/man2/unlink.2:96
3980 #, no-wrap
3981 msgid "B<ENAMETOOLONG>"
3982 msgstr ""
3983
3984 #. type: Plain text
3985 #: build/C/man2/link.2:94 build/C/man2/rename.2:163 build/C/man2/symlink.2:121
3986 msgid "I<oldpath> or I<newpath> was too long."
3987 msgstr ""
3988
3989 #. type: TP
3990 #: build/C/man2/link.2:94 build/C/man2/open.2:645 build/C/man2/readlink.2:116 build/C/man2/rename.2:163 build/C/man2/rmdir.2:80 build/C/man2/symlink.2:121 build/C/man2/unlink.2:99
3991 #, no-wrap
3992 msgid "B<ENOENT>"
3993 msgstr ""
3994
3995 #. type: Plain text
3996 #: build/C/man2/link.2:99
3997 msgid ""
3998 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
3999 "dangling symbolic link."
4000 msgstr ""
4001
4002 #. type: TP
4003 #: build/C/man2/link.2:99 build/C/man2/open.2:652 build/C/man2/readlink.2:119 build/C/man2/rename.2:176 build/C/man2/rmdir.2:85 build/C/man3/scanf.3:570 build/C/man2/symlink.2:128 build/C/man3/tempnam.3:95 build/C/man2/unlink.2:106
4004 #, no-wrap
4005 msgid "B<ENOMEM>"
4006 msgstr ""
4007
4008 #. type: Plain text
4009 #: build/C/man2/link.2:102 build/C/man2/open.2:655 build/C/man2/readlink.2:122 build/C/man2/rename.2:179 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:131 build/C/man2/unlink.2:109
4010 msgid "Insufficient kernel memory was available."
4011 msgstr ""
4012
4013 #. type: TP
4014 #: build/C/man2/link.2:102 build/C/man2/open.2:655 build/C/man2/rename.2:179 build/C/man2/symlink.2:131 build/C/man3/tmpfile.3:72 build/C/man2/write.2:168
4015 #, no-wrap
4016 msgid "B<ENOSPC>"
4017 msgstr ""
4018
4019 #. type: Plain text
4020 #: build/C/man2/link.2:106 build/C/man2/rename.2:183 build/C/man2/symlink.2:135
4021 msgid "The device containing the file has no room for the new directory entry."
4022 msgstr ""
4023
4024 #. type: TP
4025 #: build/C/man2/link.2:106 build/C/man2/open.2:661 build/C/man2/readlink.2:122 build/C/man2/rename.2:183 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:135 build/C/man2/unlink.2:109
4026 #, no-wrap
4027 msgid "B<ENOTDIR>"
4028 msgstr ""
4029
4030 #. type: Plain text
4031 #: build/C/man2/link.2:111
4032 msgid ""
4033 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
4034 "a directory."
4035 msgstr ""
4036
4037 #. type: TP
4038 #: build/C/man2/link.2:111 build/C/man2/link.2:115 build/C/man2/open.2:694 build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118 build/C/man2/symlink.2:140 build/C/man2/unlink.2:114
4039 #, no-wrap
4040 msgid "B<EPERM>"
4041 msgstr ""
4042
4043 #. type: Plain text
4044 #: build/C/man2/link.2:115
4045 msgid "I<oldpath> is a directory."
4046 msgstr ""
4047
4048 #. type: Plain text
4049 #: build/C/man2/link.2:120
4050 msgid ""
4051 "The file system containing I<oldpath> and I<newpath> does not support the "
4052 "creation of hard links."
4053 msgstr ""
4054
4055 #. type: TP
4056 #: build/C/man2/link.2:120
4057 #, no-wrap
4058 msgid "B<EPERM> (since Linux 3.6)"
4059 msgstr ""
4060
4061 #. type: Plain text
4062 #: build/C/man2/link.2:127
4063 msgid ""
4064 "The caller does not have permission to create a hard link to this file (see "
4065 "the description of I</proc/sys/fs/protected_hardlink> in B<proc>(5))."
4066 msgstr ""
4067
4068 #. type: TP
4069 #: build/C/man2/link.2:127 build/C/man2/open.2:702 build/C/man2/rename.2:221 build/C/man2/rmdir.2:123 build/C/man2/symlink.2:145 build/C/man3/tmpfile.3:75 build/C/man2/unlink.2:137
4070 #, no-wrap
4071 msgid "B<EROFS>"
4072 msgstr ""
4073
4074 #. type: Plain text
4075 #: build/C/man2/link.2:130 build/C/man2/rename.2:224
4076 msgid "The file is on a read-only file system."
4077 msgstr ""
4078
4079 #. type: TP
4080 #: build/C/man2/link.2:130 build/C/man2/rename.2:224
4081 #, no-wrap
4082 msgid "B<EXDEV>"
4083 msgstr ""
4084
4085 #. type: Plain text
4086 #: build/C/man2/link.2:138
4087 msgid ""
4088 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
4089 "permits a file system to be mounted at multiple points, but B<link>()  does "
4090 "not work across different mount points, even if the same file system is "
4091 "mounted on both.)"
4092 msgstr ""
4093
4094 #.  SVr4 documents additional ENOLINK and
4095 #.  EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
4096 #.  X/OPEN does not document EFAULT, ENOMEM or EIO.
4097 #. type: Plain text
4098 #: build/C/man2/link.2:143
4099 msgid "SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES)."
4100 msgstr ""
4101
4102 #. type: Plain text
4103 #: build/C/man2/link.2:150
4104 msgid ""
4105 "Hard links, as created by B<link>(), cannot span file systems.  Use "
4106 "B<symlink>(2)  if this is required."
4107 msgstr ""
4108
4109 #.  more precisely: since kernel 1.3.56
4110 #.  For example, the default Solaris compilation environment
4111 #.  behaves like Linux, and contributors to a March 2005
4112 #.  thread in the Austin mailing list reported that some
4113 #.  other (System V) implementations did/do the same -- MTK, Apr 05
4114 #. type: Plain text
4115 #: build/C/man2/link.2:181
4116 msgid ""
4117 "POSIX.1-2001 says that B<link>()  should dereference I<oldpath> if it is a "
4118 "symbolic link.  However, since kernel 2.0, Linux does not do so: if "
4119 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
4120 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
4121 "the same file that I<oldpath> refers to).  Some other implementations behave "
4122 "in the same manner as Linux.  POSIX.1-2008 changes the specification of "
4123 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
4124 "dereferenced if it is a symbolic link.  For precise control over the "
4125 "treatment of symbolic links when creating a link, see B<linkat>(2)."
4126 msgstr ""
4127
4128 #. type: Plain text
4129 #: build/C/man2/link.2:187
4130 msgid ""
4131 "On NFS file systems, the return code may be wrong in case the NFS server "
4132 "performs the link creation and dies before it can say so.  Use B<stat>(2)  "
4133 "to find out if the link got created."
4134 msgstr ""
4135
4136 #. type: Plain text
4137 #: build/C/man2/link.2:197
4138 msgid ""
4139 "B<ln>(1), B<linkat>(2), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), "
4140 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
4141 msgstr ""
4142
4143 #. type: TH
4144 #: build/C/man2/llseek.2:28
4145 #, no-wrap
4146 msgid "LLSEEK"
4147 msgstr ""
4148
4149 #. type: TH
4150 #: build/C/man2/llseek.2:28
4151 #, no-wrap
4152 msgid "2012-07-13"
4153 msgstr ""
4154
4155 #. type: Plain text
4156 #: build/C/man2/llseek.2:31
4157 msgid "_llseek - reposition read/write file offset"
4158 msgstr ""
4159
4160 #. type: Plain text
4161 #: build/C/man2/llseek.2:35
4162 #, no-wrap
4163 msgid ""
4164 "B<#include E<lt>sys/types.hE<gt>>\n"
4165 "B<#include E<lt>unistd.hE<gt>>\n"
4166 msgstr ""
4167
4168 #. type: Plain text
4169 #: build/C/man2/llseek.2:39
4170 #, no-wrap
4171 msgid ""
4172 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
4173 "B<            unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
4174 "B<            unsigned int >I<whence>B<);>\n"
4175 msgstr ""
4176
4177 #. type: Plain text
4178 #: build/C/man2/llseek.2:43
4179 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
4180 msgstr ""
4181
4182 #. type: Plain text
4183 #: build/C/man2/llseek.2:62
4184 msgid ""
4185 "The B<_llseek>()  function repositions the offset of the open file "
4186 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
4187 "offset_low> bytes relative to the beginning of the file, the current "
4188 "position in the file, or the end of the file, depending on whether I<whence> "
4189 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively.  It returns the "
4190 "resulting file position in the argument I<result>."
4191 msgstr ""
4192
4193 #. type: Plain text
4194 #: build/C/man2/llseek.2:69
4195 msgid ""
4196 "Upon successful completion, B<_llseek>()  returns 0.  Otherwise, a value of "
4197 "-1 is returned and I<errno> is set to indicate the error."
4198 msgstr ""
4199
4200 #. type: Plain text
4201 #: build/C/man2/llseek.2:74 build/C/man2/lseek.2:175
4202 msgid "I<fd> is not an open file descriptor."
4203 msgstr ""
4204
4205 #. type: Plain text
4206 #: build/C/man2/llseek.2:77
4207 msgid "Problem with copying results to user space."
4208 msgstr ""
4209
4210 #. type: Plain text
4211 #: build/C/man2/llseek.2:81
4212 msgid "I<whence> is invalid."
4213 msgstr ""
4214
4215 #. type: Plain text
4216 #: build/C/man2/llseek.2:84
4217 msgid ""
4218 "This function is Linux-specific, and should not be used in programs intended "
4219 "to be portable."
4220 msgstr ""
4221
4222 #. type: Plain text
4223 #: build/C/man2/llseek.2:87
4224 msgid ""
4225 "Glibc does not provide a wrapper for this system call; call it using "
4226 "B<syscall>(2)."
4227 msgstr ""
4228
4229 #. type: Plain text
4230 #: build/C/man2/llseek.2:90
4231 msgid "B<lseek>(2), B<lseek64>(3)"
4232 msgstr ""
4233
4234 #. type: TH
4235 #: build/C/man2/lseek.2:47
4236 #, no-wrap
4237 msgid "LSEEK"
4238 msgstr ""
4239
4240 #. type: TH
4241 #: build/C/man2/lseek.2:47
4242 #, no-wrap
4243 msgid "2013-03-27"
4244 msgstr ""
4245
4246 #. type: Plain text
4247 #: build/C/man2/lseek.2:50
4248 msgid "lseek - reposition read/write file offset"
4249 msgstr ""
4250
4251 #. type: Plain text
4252 #: build/C/man2/lseek.2:52 build/C/man3/lseek64.3:32
4253 msgid "B<#include E<lt>sys/types.hE<gt>>"
4254 msgstr ""
4255
4256 #. type: Plain text
4257 #: build/C/man2/lseek.2:56
4258 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
4259 msgstr ""
4260
4261 #. type: Plain text
4262 #: build/C/man2/lseek.2:67
4263 msgid ""
4264 "The B<lseek>()  function repositions the offset of the open file associated "
4265 "with the file descriptor I<fd> to the argument I<offset> according to the "
4266 "directive I<whence> as follows:"
4267 msgstr ""
4268
4269 #. type: Plain text
4270 #: build/C/man2/lseek.2:72
4271 msgid "The offset is set to I<offset> bytes."
4272 msgstr ""
4273
4274 #. type: Plain text
4275 #: build/C/man2/lseek.2:77
4276 msgid "The offset is set to its current location plus I<offset> bytes."
4277 msgstr ""
4278
4279 #. type: Plain text
4280 #: build/C/man2/lseek.2:82
4281 msgid "The offset is set to the size of the file plus I<offset> bytes."
4282 msgstr ""
4283
4284 #. type: Plain text
4285 #: build/C/man2/lseek.2:90
4286 msgid ""
4287 "The B<lseek>()  function allows the file offset to be set beyond the end of "
4288 "the file (but this does not change the size of the file).  If data is later "
4289 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
4290 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
4291 "gap."
4292 msgstr ""
4293
4294 #. type: SS
4295 #: build/C/man2/lseek.2:90
4296 #, no-wrap
4297 msgid "Seeking file data and holes"
4298 msgstr ""
4299
4300 #. type: Plain text
4301 #: build/C/man2/lseek.2:93
4302 msgid ""
4303 "Since version 3.1, Linux supports the following additional values for "
4304 "I<whence>:"
4305 msgstr ""
4306
4307 #. type: TP
4308 #: build/C/man2/lseek.2:93
4309 #, no-wrap
4310 msgid "B<SEEK_DATA>"
4311 msgstr ""
4312
4313 #. type: Plain text
4314 #: build/C/man2/lseek.2:104
4315 msgid ""
4316 "Adjust the file offset to the next location in the file greater than or "
4317 "equal to I<offset> containing data.  If I<offset> points to data, then the "
4318 "file offset is set to I<offset>."
4319 msgstr ""
4320
4321 #. type: TP
4322 #: build/C/man2/lseek.2:104
4323 #, no-wrap
4324 msgid "B<SEEK_HOLE>"
4325 msgstr ""
4326
4327 #. type: Plain text
4328 #: build/C/man2/lseek.2:118
4329 msgid ""
4330 "Adjust the file offset to the next hole in the file greater than or equal to "
4331 "I<offset>.  If I<offset> points into the middle of a hole, then the file "
4332 "offset is set to I<offset>.  If there is no hole past I<offset>, then the "
4333 "file offset is adjusted to the end of the file (i.e., there is an implicit "
4334 "hole at the end of any file)."
4335 msgstr ""
4336
4337 #. type: Plain text
4338 #: build/C/man2/lseek.2:124
4339 msgid ""
4340 "In both of the above cases, B<lseek>()  fails if I<offset> points past the "
4341 "end of the file."
4342 msgstr ""
4343
4344 #. type: Plain text
4345 #: build/C/man2/lseek.2:130
4346 msgid ""
4347 "These operations allow applications to map holes in a sparsely allocated "
4348 "file.  This can be useful for applications such as file backup tools, which "
4349 "can save space when creating backups and preserve holes, if they have a "
4350 "mechanism for discovering holes."
4351 msgstr ""
4352
4353 #.  https://lkml.org/lkml/2011/4/22/79
4354 #.  http://lwn.net/Articles/440255/
4355 #.  http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
4356 #. type: Plain text
4357 #: build/C/man2/lseek.2:153
4358 msgid ""
4359 "For the purposes of these operations, a hole is a sequence of zeros that "
4360 "(normally) has not been allocated in the underlying file storage.  However, "
4361 "a file system is not obliged to report holes, so these operations are not a "
4362 "guaranteed mechanism for mapping the storage space actually allocated to a "
4363 "file.  (Furthermore, a sequence of zeros that actually has been written to "
4364 "the underlying storage may not be reported as a hole.)  In the simplest "
4365 "implementation, a file system can support the operations by making "
4366 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
4367 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
4368 "by I<offset> is a hole, it can be considered to consist of data that is a "
4369 "sequence of zeros)."
4370 msgstr ""
4371
4372 #. type: Plain text
4373 #: build/C/man2/lseek.2:162
4374 msgid ""
4375 "The B<_GNU_SOURCE> feature test macro must be defined in order to obtain the "
4376 "definitions of B<SEEK_DATA> and B<SEEK_HOLE> from I<E<lt>unistd.hE<gt>>."
4377 msgstr ""
4378
4379 #. type: Plain text
4380 #: build/C/man2/lseek.2:170
4381 msgid ""
4382 "Upon successful completion, B<lseek>()  returns the resulting offset "
4383 "location as measured in bytes from the beginning of the file.  On error, the "
4384 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
4385 msgstr ""
4386
4387 #.  Some systems may allow negative offsets for character devices
4388 #.  and/or for remote file systems.
4389 #. type: Plain text
4390 #: build/C/man2/lseek.2:183
4391 msgid ""
4392 "I<whence> is not valid.  Or: the resulting file offset would be negative, or "
4393 "beyond the end of a seekable device."
4394 msgstr ""
4395
4396 #. type: TP
4397 #: build/C/man2/lseek.2:183 build/C/man2/open.2:674
4398 #, no-wrap
4399 msgid "B<EOVERFLOW>"
4400 msgstr ""
4401
4402 #.  HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
4403 #. type: Plain text
4404 #: build/C/man2/lseek.2:188
4405 msgid "The resulting file offset cannot be represented in an I<off_t>."
4406 msgstr ""
4407
4408 #. type: TP
4409 #: build/C/man2/lseek.2:188
4410 #, no-wrap
4411 msgid "B<ESPIPE>"
4412 msgstr ""
4413
4414 #. type: Plain text
4415 #: build/C/man2/lseek.2:192
4416 msgid "I<fd> is associated with a pipe, socket, or FIFO."
4417 msgstr ""
4418
4419 #. type: TP
4420 #: build/C/man2/lseek.2:192 build/C/man2/open.2:668
4421 #, no-wrap
4422 msgid "B<ENXIO>"
4423 msgstr ""
4424
4425 #. type: Plain text
4426 #: build/C/man2/lseek.2:200
4427 msgid ""
4428 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
4429 "beyond the end of the file."
4430 msgstr ""
4431
4432 #.  SVr4 documents additional error
4433 #.  conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
4434 #. type: Plain text
4435 #: build/C/man2/lseek.2:202 build/C/man2/read.2:175 build/C/man2/rmdir.2:129 build/C/man2/symlink.2:155 build/C/man2/unlink.2:145 build/C/man2/write.2:189
4436 msgid "SVr4, 4.3BSD, POSIX.1-2001."
4437 msgstr ""
4438
4439 #.  FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
4440 #. type: Plain text
4441 #: build/C/man2/lseek.2:210
4442 msgid ""
4443 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
4444 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
4445 "next POSIX revision (Issue 8)."
4446 msgstr ""
4447
4448 #. type: Plain text
4449 #: build/C/man2/lseek.2:214
4450 msgid ""
4451 "Some devices are incapable of seeking and POSIX does not specify which "
4452 "devices must support B<lseek>()."
4453 msgstr ""
4454
4455 #.  Other systems return the number of written characters,
4456 #.  using SEEK_SET to set the counter. (Of written characters.)
4457 #. type: Plain text
4458 #: build/C/man2/lseek.2:221
4459 msgid "On Linux, using B<lseek>()  on a terminal device returns B<ESPIPE>."
4460 msgstr ""
4461
4462 #. type: Plain text
4463 #: build/C/man2/lseek.2:224
4464 msgid ""
4465 "When converting old code, substitute values for I<whence> with the following "
4466 "macros:"
4467 msgstr ""
4468
4469 #. type: tbl table
4470 #: build/C/man2/lseek.2:227
4471 #, no-wrap
4472 msgid "old\tnew\n"
4473 msgstr ""
4474
4475 #. type: tbl table
4476 #: build/C/man2/lseek.2:228
4477 #, no-wrap
4478 msgid "0\tSEEK_SET\n"
4479 msgstr ""
4480
4481 #. type: tbl table
4482 #: build/C/man2/lseek.2:229
4483 #, no-wrap
4484 msgid "1\tSEEK_CUR\n"
4485 msgstr ""
4486
4487 #. type: tbl table
4488 #: build/C/man2/lseek.2:230
4489 #, no-wrap
4490 msgid "2\tSEEK_END\n"
4491 msgstr ""
4492
4493 #. type: tbl table
4494 #: build/C/man2/lseek.2:231
4495 #, no-wrap
4496 msgid "L_SET\tSEEK_SET\n"
4497 msgstr ""
4498
4499 #. type: tbl table
4500 #: build/C/man2/lseek.2:232
4501 #, no-wrap
4502 msgid "L_INCR\tSEEK_CUR\n"
4503 msgstr ""
4504
4505 #. type: tbl table
4506 #: build/C/man2/lseek.2:233
4507 #, no-wrap
4508 msgid "L_XTND\tSEEK_END\n"
4509 msgstr ""
4510
4511 #. type: Plain text
4512 #: build/C/man2/lseek.2:245
4513 msgid ""
4514 "Note that file descriptors created by B<dup>(2)  or B<fork>(2)  share the "
4515 "current file position pointer, so seeking on such files may be subject to "
4516 "race conditions."
4517 msgstr ""
4518
4519 #. type: Plain text
4520 #: build/C/man2/lseek.2:252
4521 msgid ""
4522 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
4523 "B<posix_fallocate>(3)"
4524 msgstr ""
4525
4526 #. type: TH
4527 #: build/C/man3/lseek64.3:25
4528 #, no-wrap
4529 msgid "LSEEK64"
4530 msgstr ""
4531
4532 #. type: TH
4533 #: build/C/man3/lseek64.3:25
4534 #, no-wrap
4535 msgid "2004-12-11"
4536 msgstr ""
4537
4538 #. type: Plain text
4539 #: build/C/man3/lseek64.3:28
4540 msgid "lseek64 - reposition 64-bit read/write file offset"
4541 msgstr ""
4542
4543 #. type: Plain text
4544 #: build/C/man3/lseek64.3:30
4545 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
4546 msgstr ""
4547
4548 #. type: Plain text
4549 #: build/C/man3/lseek64.3:36
4550 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
4551 msgstr ""
4552
4553 #. type: Plain text
4554 #: build/C/man3/lseek64.3:53
4555 msgid ""
4556 "The B<lseek>(2)  family of functions reposition the offset of the open file "
4557 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
4558 "start, current position, or end of the file, when I<whence> has the value "
4559 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
4560 msgstr ""
4561
4562 #. type: Plain text
4563 #: build/C/man3/lseek64.3:56
4564 msgid "For more details, return value, and errors, see B<lseek>(2)."
4565 msgstr ""
4566
4567 #. type: Plain text
4568 #: build/C/man3/lseek64.3:63
4569 msgid ""
4570 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
4571 "the raw system call B<_llseek>(2)."
4572 msgstr ""
4573
4574 #. type: SS
4575 #: build/C/man3/lseek64.3:63
4576 #, no-wrap
4577 msgid "lseek"
4578 msgstr ""
4579
4580 #. type: Plain text
4581 #: build/C/man3/lseek64.3:65 build/C/man3/lseek64.3:87 build/C/man3/lseek64.3:116
4582 msgid "Prototype:"
4583 msgstr ""
4584
4585 #. type: Plain text
4586 #: build/C/man3/lseek64.3:69
4587 #, no-wrap
4588 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4589 msgstr ""
4590
4591 #. type: Plain text
4592 #: build/C/man3/lseek64.3:77
4593 msgid ""
4594 "B<lseek>(2)  uses the type I<off_t>.  This is a 32-bit signed type on 32-bit "
4595 "architectures, unless one compiles with"
4596 msgstr ""
4597
4598 #. type: Plain text
4599 #: build/C/man3/lseek64.3:85
4600 msgid "in which case it is a 64-bit signed type."
4601 msgstr ""
4602
4603 #. type: SS
4604 #: build/C/man3/lseek64.3:85
4605 #, no-wrap
4606 msgid "lseek64"
4607 msgstr ""
4608
4609 #. type: Plain text
4610 #: build/C/man3/lseek64.3:91
4611 #, no-wrap
4612 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
4613 msgstr ""
4614
4615 #. type: Plain text
4616 #: build/C/man3/lseek64.3:102
4617 msgid ""
4618 "The library routine B<lseek64>()  uses a 64-bit type even when I<off_t> is a "
4619 "32-bit type.  Its prototype (and the type I<off64_t>)  is available only "
4620 "when one compiles with"
4621 msgstr ""
4622
4623 #. type: Plain text
4624 #: build/C/man3/lseek64.3:106
4625 #, no-wrap
4626 msgid "#define _LARGEFILE64_SOURCE\n"
4627 msgstr ""
4628
4629 #.  in glibc 2.0.94, not in 2.0.6
4630 #. type: Plain text
4631 #: build/C/man3/lseek64.3:114
4632 msgid ""
4633 "The function B<lseek64>()  is available since glibc 2.1, and is defined to "
4634 "be an alias for B<llseek>()."
4635 msgstr ""
4636
4637 #. type: SS
4638 #: build/C/man3/lseek64.3:114
4639 #, no-wrap
4640 msgid "llseek"
4641 msgstr ""
4642
4643 #. type: Plain text
4644 #: build/C/man3/lseek64.3:120
4645 #, no-wrap
4646 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
4647 msgstr ""
4648
4649 #.  in libc 5.0.9, not in 4.7.6
4650 #. type: Plain text
4651 #: build/C/man3/lseek64.3:139
4652 msgid ""
4653 "The type I<loff_t> is a 64-bit signed type.  The library routine B<llseek>()  "
4654 "is available in libc5 and glibc and works without special defines.  Its "
4655 "prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but glibc does not "
4656 "provide a prototype.  This is bad, since a prototype is needed.  Users "
4657 "should add the above prototype, or something equivalent, to their own "
4658 "source.  When users complained about data loss caused by a miscompilation of "
4659 "B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
4660 msgstr ""
4661
4662 #. type: Plain text
4663 #: build/C/man3/lseek64.3:142
4664 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
4665 msgstr ""
4666
4667 #. type: Plain text
4668 #: build/C/man3/lseek64.3:146
4669 msgid "This makes this function unusable if one desires a warning-free compilation."
4670 msgstr ""
4671
4672 #. type: SS
4673 #: build/C/man3/lseek64.3:146
4674 #, no-wrap
4675 msgid "_llseek"
4676 msgstr ""
4677
4678 #. type: Plain text
4679 #: build/C/man3/lseek64.3:149
4680 msgid ""
4681 "All the above functions are implemented in terms of this system call.  The "
4682 "prototype is:"
4683 msgstr ""
4684
4685 #. type: Plain text
4686 #: build/C/man3/lseek64.3:154
4687 #, no-wrap
4688 msgid ""
4689 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
4690 "B<            loff_t *>I<result>B<, int >I<whence>B<);>\n"
4691 msgstr ""
4692
4693 #. type: Plain text
4694 #: build/C/man3/lseek64.3:159
4695 msgid "For more details, see B<llseek>(2)."
4696 msgstr ""
4697
4698 #. type: Plain text
4699 #: build/C/man3/lseek64.3:162
4700 msgid "B<llseek>(2), B<lseek>(2)"
4701 msgstr ""
4702
4703 #. type: TH
4704 #: build/C/man2/open.2:51
4705 #, no-wrap
4706 msgid "OPEN"
4707 msgstr ""
4708
4709 #. type: TH
4710 #: build/C/man2/open.2:51
4711 #, no-wrap
4712 msgid "2013-07-21"
4713 msgstr ""
4714
4715 #. type: Plain text
4716 #: build/C/man2/open.2:54
4717 msgid "open, creat - open and possibly create a file or device"
4718 msgstr ""
4719
4720 #. type: Plain text
4721 #: build/C/man2/open.2:59
4722 #, no-wrap
4723 msgid ""
4724 "B<#include E<lt>sys/types.hE<gt>>\n"
4725 "B<#include E<lt>sys/stat.hE<gt>>\n"
4726 "B<#include E<lt>fcntl.hE<gt>>\n"
4727 msgstr ""
4728
4729 #. type: Plain text
4730 #: build/C/man2/open.2:62
4731 #, no-wrap
4732 msgid ""
4733 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
4734 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t "
4735 ">I<mode>B<);>\n"
4736 msgstr ""
4737
4738 #. type: Plain text
4739 #: build/C/man2/open.2:64
4740 #, no-wrap
4741 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
4742 msgstr ""
4743
4744 #. type: Plain text
4745 #: build/C/man2/open.2:75
4746 msgid ""
4747 "Given a I<pathname> for a file, B<open>()  returns a file descriptor, a "
4748 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
4749 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.).  The file descriptor returned "
4750 "by a successful call will be the lowest-numbered file descriptor not "
4751 "currently open for the process."
4752 msgstr ""
4753
4754 #. type: Plain text
4755 #: build/C/man2/open.2:87
4756 msgid ""
4757 "By default, the new file descriptor is set to remain open across an "
4758 "B<execve>(2)  (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
4759 "B<fcntl>(2)  is initially disabled; the B<O_CLOEXEC> flag, described below, "
4760 "can be used to change this default).  The file offset is set to the "
4761 "beginning of the file (see B<lseek>(2))."
4762 msgstr ""
4763
4764 #. type: Plain text
4765 #: build/C/man2/open.2:106
4766 msgid ""
4767 "A call to B<open>()  creates a new I<open file description>, an entry in the "
4768 "system-wide table of open files.  This entry records the file offset and the "
4769 "file status flags (modifiable via the B<fcntl>(2)  B<F_SETFL> operation).  A "
4770 "file descriptor is a reference to one of these entries; this reference is "
4771 "unaffected if I<pathname> is subsequently removed or modified to refer to a "
4772 "different file.  The new open file description is initially not shared with "
4773 "any other process, but sharing may arise via B<fork>(2)."
4774 msgstr ""
4775
4776 #. type: Plain text
4777 #: build/C/man2/open.2:114
4778 msgid ""
4779 "The argument I<flags> must include one of the following I<access modes>: "
4780 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>.  These request opening the file "
4781 "read-only, write-only, or read/write, respectively."
4782 msgstr ""
4783
4784 #.  SUSv4 divides the flags into:
4785 #.  * Access mode
4786 #.  * File creation
4787 #.  * File status
4788 #.  * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
4789 #.  though it's not clear what the difference between "other" and
4790 #.  "File creation" flags is.  I raised an Aardvark to see if this
4791 #.  can be clarified in SUSv4; 10 Oct 2008.
4792 #.  http://thread.gmane.org/gmane.comp.standards.posix.austin.general/64/focus=67
4793 #.  TC1 (balloted in 2013), resolved this, so that those three constants
4794 #.  are also categorized" as file status flags.
4795 #. type: Plain text
4796 #: build/C/man2/open.2:152
4797 msgid ""
4798 "In addition, zero or more file creation flags and file status flags can be "
4799 "bitwise-I<or>'d in I<flags>.  The I<file creation flags> are B<O_CLOEXEC>, "
4800 "B<O_CREAT>, B<O_DIRECTORY>, B<O_EXCL>, B<O_NOCTTY>, B<O_NOFOLLOW>, "
4801 "B<O_TRUNC>, and B<O_TTY_INIT>.  The I<file status flags> are all of the "
4802 "remaining flags listed below.  The distinction between these two groups of "
4803 "flags is that the file status flags can be retrieved and (in some cases)  "
4804 "modified using B<fcntl>(2).  The full list of file creation flags and file "
4805 "status flags is as follows:"
4806 msgstr ""
4807
4808 #. type: TP
4809 #: build/C/man2/open.2:152
4810 #, no-wrap
4811 msgid "B<O_APPEND>"
4812 msgstr ""
4813
4814 #.  For more background, see
4815 #.  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
4816 #.  http://nfs.sourceforge.net/
4817 #. type: Plain text
4818 #: build/C/man2/open.2:169
4819 msgid ""
4820 "The file is opened in append mode.  Before each B<write>(2), the file offset "
4821 "is positioned at the end of the file, as if with B<lseek>(2).  B<O_APPEND> "
4822 "may lead to corrupted files on NFS file systems if more than one process "
4823 "appends data to a file at once.  This is because NFS does not support "
4824 "appending to a file, so the client kernel has to simulate it, which can't be "
4825 "done without a race condition."
4826 msgstr ""
4827
4828 #. type: TP
4829 #: build/C/man2/open.2:169
4830 #, no-wrap
4831 msgid "B<O_ASYNC>"
4832 msgstr ""
4833
4834 #. type: Plain text
4835 #: build/C/man2/open.2:182
4836 msgid ""
4837 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
4838 "can be changed via B<fcntl>(2))  when input or output becomes possible on "
4839 "this file descriptor.  This feature is available only for terminals, "
4840 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs.  See "
4841 "B<fcntl>(2)  for further details."
4842 msgstr ""
4843
4844 #. type: TP
4845 #: build/C/man2/open.2:182
4846 #, no-wrap
4847 msgid "B<O_CLOEXEC> (Since Linux 2.6.23)"
4848 msgstr ""
4849
4850 #.  This flag fixes only one form of the race condition;
4851 #.  The race can also occur with, for example, descriptors
4852 #.  returned by accept(), pipe(), etc.
4853 #. type: Plain text
4854 #: build/C/man2/open.2:207
4855 msgid ""
4856 "Enable the close-on-exec flag for the new file descriptor.  Specifying this "
4857 "flag permits a program to avoid additional B<fcntl>(2)  B<F_SETFD> "
4858 "operations to set the B<FD_CLOEXEC> flag.  Additionally, use of this flag is "
4859 "essential in some multithreaded programs since using a separate B<fcntl>(2)  "
4860 "B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not suffice to avoid "
4861 "race conditions where one thread opens a file descriptor at the same time as "
4862 "another thread does a B<fork>(2)  plus B<execve>(2)."
4863 msgstr ""
4864
4865 #. type: TP
4866 #: build/C/man2/open.2:207
4867 #, no-wrap
4868 msgid "B<O_CREAT>"
4869 msgstr ""
4870
4871 #.  As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
4872 #.  XFS (since 2.6.14).
4873 #. type: Plain text
4874 #: build/C/man2/open.2:223
4875 msgid ""
4876 "If the file does not exist it will be created.  The owner (user ID) of the "
4877 "file is set to the effective user ID of the process.  The group ownership "
4878 "(group ID) is set either to the effective group ID of the process or to the "
4879 "group ID of the parent directory (depending on file system type and mount "
4880 "options, and the mode of the parent directory, see the mount options "
4881 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
4882 msgstr ""
4883
4884 #. type: Plain text
4885 #: build/C/man2/open.2:246
4886 msgid ""
4887 "I<mode> specifies the permissions to use in case a new file is created.  "
4888 "This argument must be supplied when B<O_CREAT> is specified in I<flags>; if "
4889 "B<O_CREAT> is not specified, then I<mode> is ignored.  The effective "
4890 "permissions are modified by the process's I<umask> in the usual way: The "
4891 "permissions of the created file are I<(mode\\ &\\ ~umask)>.  Note that this "
4892 "mode applies only to future accesses of the newly created file; the "
4893 "B<open>()  call that creates a read-only file may well return a read/write "
4894 "file descriptor."
4895 msgstr ""
4896
4897 #. type: Plain text
4898 #: build/C/man2/open.2:249
4899 msgid "The following symbolic constants are provided for I<mode>:"
4900 msgstr ""
4901
4902 #. type: TP
4903 #: build/C/man2/open.2:249
4904 #, no-wrap
4905 msgid "B<S_IRWXU>"
4906 msgstr ""
4907
4908 #. type: Plain text
4909 #: build/C/man2/open.2:252
4910 msgid "00700 user (file owner) has read, write and execute permission"
4911 msgstr ""
4912
4913 #. type: TP
4914 #: build/C/man2/open.2:252
4915 #, no-wrap
4916 msgid "B<S_IRUSR>"
4917 msgstr ""
4918
4919 #. type: Plain text
4920 #: build/C/man2/open.2:255
4921 msgid "00400 user has read permission"
4922 msgstr ""
4923
4924 #. type: TP
4925 #: build/C/man2/open.2:255
4926 #, no-wrap
4927 msgid "B<S_IWUSR>"
4928 msgstr ""
4929
4930 #. type: Plain text
4931 #: build/C/man2/open.2:258
4932 msgid "00200 user has write permission"
4933 msgstr ""
4934
4935 #. type: TP
4936 #: build/C/man2/open.2:258
4937 #, no-wrap
4938 msgid "B<S_IXUSR>"
4939 msgstr ""
4940
4941 #. type: Plain text
4942 #: build/C/man2/open.2:261
4943 msgid "00100 user has execute permission"
4944 msgstr ""
4945
4946 #. type: TP
4947 #: build/C/man2/open.2:261
4948 #, no-wrap
4949 msgid "B<S_IRWXG>"
4950 msgstr ""
4951
4952 #. type: Plain text
4953 #: build/C/man2/open.2:264
4954 msgid "00070 group has read, write and execute permission"
4955 msgstr ""
4956
4957 #. type: TP
4958 #: build/C/man2/open.2:264
4959 #, no-wrap
4960 msgid "B<S_IRGRP>"
4961 msgstr ""
4962
4963 #. type: Plain text
4964 #: build/C/man2/open.2:267
4965 msgid "00040 group has read permission"
4966 msgstr ""
4967
4968 #. type: TP
4969 #: build/C/man2/open.2:267
4970 #, no-wrap
4971 msgid "B<S_IWGRP>"
4972 msgstr ""
4973
4974 #. type: Plain text
4975 #: build/C/man2/open.2:270
4976 msgid "00020 group has write permission"
4977 msgstr ""
4978
4979 #. type: TP
4980 #: build/C/man2/open.2:270
4981 #, no-wrap
4982 msgid "B<S_IXGRP>"
4983 msgstr ""
4984
4985 #. type: Plain text
4986 #: build/C/man2/open.2:273
4987 msgid "00010 group has execute permission"
4988 msgstr ""
4989
4990 #. type: TP
4991 #: build/C/man2/open.2:273
4992 #, no-wrap
4993 msgid "B<S_IRWXO>"
4994 msgstr ""
4995
4996 #. type: Plain text
4997 #: build/C/man2/open.2:276
4998 msgid "00007 others have read, write and execute permission"
4999 msgstr ""
5000
5001 #. type: TP
5002 #: build/C/man2/open.2:276
5003 #, no-wrap
5004 msgid "B<S_IROTH>"
5005 msgstr ""
5006
5007 #. type: Plain text
5008 #: build/C/man2/open.2:279
5009 msgid "00004 others have read permission"
5010 msgstr ""
5011
5012 #. type: TP
5013 #: build/C/man2/open.2:279
5014 #, no-wrap
5015 msgid "B<S_IWOTH>"
5016 msgstr ""
5017
5018 #. type: Plain text
5019 #: build/C/man2/open.2:282
5020 msgid "00002 others have write permission"
5021 msgstr ""
5022
5023 #. type: TP
5024 #: build/C/man2/open.2:282
5025 #, no-wrap
5026 msgid "B<S_IXOTH>"
5027 msgstr ""
5028
5029 #. type: Plain text
5030 #: build/C/man2/open.2:285
5031 msgid "00001 others have execute permission"
5032 msgstr ""
5033
5034 #. type: TP
5035 #: build/C/man2/open.2:286
5036 #, no-wrap
5037 msgid "B<O_DIRECT> (Since Linux 2.4.10)"
5038 msgstr ""
5039
5040 #. type: Plain text
5041 #: build/C/man2/open.2:303
5042 msgid ""
5043 "Try to minimize cache effects of the I/O to and from this file.  In general "
5044 "this will degrade performance, but it is useful in special situations, such "
5045 "as when applications do their own caching.  File I/O is done directly "
5046 "to/from user-space buffers.  The B<O_DIRECT> flag on its own makes an effort "
5047 "to transfer data synchronously, but does not give the guarantees of the "
5048 "B<O_SYNC> flag that data and necessary metadata are transferred.  To "
5049 "guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
5050 "B<O_DIRECT>.  See NOTES below for further discussion."
5051 msgstr ""
5052
5053 #. type: Plain text
5054 #: build/C/man2/open.2:307
5055 msgid ""
5056 "A semantically similar (but deprecated) interface for block devices is "
5057 "described in B<raw>(8)."
5058 msgstr ""
5059
5060 #. type: TP
5061 #: build/C/man2/open.2:307
5062 #, no-wrap
5063 msgid "B<O_DIRECTORY>"
5064 msgstr ""
5065
5066 #.  But see the following and its replies:
5067 #.  http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
5068 #.  [PATCH] open: O_DIRECTORY and O_CREAT together should fail
5069 #.  O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
5070 #. type: Plain text
5071 #: build/C/man2/open.2:319
5072 msgid ""
5073 "If I<pathname> is not a directory, cause the open to fail.  This flag is "
5074 "Linux-specific, and was added in kernel version 2.1.126, to avoid "
5075 "denial-of-service problems if B<opendir>(3)  is called on a FIFO or tape "
5076 "device."
5077 msgstr ""
5078
5079 #. type: TP
5080 #: build/C/man2/open.2:319
5081 #, no-wrap
5082 msgid "B<O_EXCL>"
5083 msgstr ""
5084
5085 #. type: Plain text
5086 #: build/C/man2/open.2:329
5087 msgid ""
5088 "Ensure that this call creates the file: if this flag is specified in "
5089 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>()  "
5090 "will fail."
5091 msgstr ""
5092
5093 #.  POSIX.1-2001 explicitly requires this behavior.
5094 #. type: Plain text
5095 #: build/C/man2/open.2:337
5096 msgid ""
5097 "When these two flags are specified, symbolic links are not followed: if "
5098 "I<pathname> is a symbolic link, then B<open>()  fails regardless of where "
5099 "the symbolic link points to."
5100 msgstr ""
5101
5102 #. type: Plain text
5103 #: build/C/man2/open.2:353
5104 msgid ""
5105 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
5106 "B<O_CREAT>.  There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
5107 "be used without B<O_CREAT> if I<pathname> refers to a block device.  If the "
5108 "block device is in use by the system (e.g., mounted), B<open>()  fails with "
5109 "the error B<EBUSY>."
5110 msgstr ""
5111
5112 #. type: Plain text
5113 #: build/C/man2/open.2:375
5114 msgid ""
5115 "On NFS, B<O_EXCL> is supported only when using NFSv3 or later on kernel 2.6 "
5116 "or later.  In NFS environments where B<O_EXCL> support is not provided, "
5117 "programs that rely on it for performing locking tasks will contain a race "
5118 "condition.  Portable programs that want to perform atomic file locking using "
5119 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
5120 "create a unique file on the same file system (e.g., incorporating hostname "
5121 "and PID), and use B<link>(2)  to make a link to the lockfile.  If B<link>(2)  "
5122 "returns 0, the lock is successful.  Otherwise, use B<stat>(2)  on the unique "
5123 "file to check if its link count has increased to 2, in which case the lock "
5124 "is also successful."
5125 msgstr ""
5126
5127 #. type: TP
5128 #: build/C/man2/open.2:375
5129 #, no-wrap
5130 msgid "B<O_LARGEFILE>"
5131 msgstr ""
5132
5133 #. type: Plain text
5134 #: build/C/man2/open.2:397
5135 msgid ""
5136 "(LFS)  Allow files whose sizes cannot be represented in an I<off_t> (but can "
5137 "be represented in an I<off64_t>)  to be opened.  The B<_LARGEFILE64_SOURCE> "
5138 "macro must be defined (before including I<any> header files)  in order to "
5139 "obtain this definition.  Setting the B<_FILE_OFFSET_BITS> feature test macro "
5140 "to 64 (rather than using B<O_LARGEFILE>)  is the preferred method of "
5141 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
5142 msgstr ""
5143
5144 #. type: TP
5145 #: build/C/man2/open.2:397
5146 #, no-wrap
5147 msgid "B<O_NOATIME> (Since Linux 2.6.8)"
5148 msgstr ""
5149
5150 #.  The O_NOATIME flag also affects the treatment of st_atime
5151 #.  by mmap() and readdir(2), MTK, Dec 04.
5152 #. type: Plain text
5153 #: build/C/man2/open.2:410
5154 msgid ""
5155 "Do not update the file last access time (I<st_atime> in the inode)  when the "
5156 "file is B<read>(2).  This flag is intended for use by indexing or backup "
5157 "programs, where its use can significantly reduce the amount of disk "
5158 "activity.  This flag may not be effective on all file systems.  One example "
5159 "is NFS, where the server maintains the access time."
5160 msgstr ""
5161
5162 #. type: TP
5163 #: build/C/man2/open.2:410
5164 #, no-wrap
5165 msgid "B<O_NOCTTY>"
5166 msgstr ""
5167
5168 #. type: Plain text
5169 #: build/C/man2/open.2:418
5170 msgid ""
5171 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(emit will not "
5172 "become the process's controlling terminal even if the process does not have "
5173 "one."
5174 msgstr ""
5175
5176 #. type: TP
5177 #: build/C/man2/open.2:418
5178 #, no-wrap
5179 msgid "B<O_NOFOLLOW>"
5180 msgstr ""
5181
5182 #.  The headers from glibc 2.0.100 and later include a
5183 #.  definition of this flag; \fIkernels before 2.1.126 will ignore it if
5184 #.  used\fP.
5185 #. type: Plain text
5186 #: build/C/man2/open.2:430
5187 msgid ""
5188 "If I<pathname> is a symbolic link, then the open fails.  This is a FreeBSD "
5189 "extension, which was added to Linux in version 2.1.126.  Symbolic links in "
5190 "earlier components of the pathname will still be followed.  See also "
5191 "B<O_NOPATH> below."
5192 msgstr ""
5193
5194 #. type: TP
5195 #: build/C/man2/open.2:430
5196 #, no-wrap
5197 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
5198 msgstr ""
5199
5200 #. type: Plain text
5201 #: build/C/man2/open.2:443
5202 msgid ""
5203 "When possible, the file is opened in nonblocking mode.  Neither the "
5204 "B<open>()  nor any subsequent operations on the file descriptor which is "
5205 "returned will cause the calling process to wait.  For the handling of FIFOs "
5206 "(named pipes), see also B<fifo>(7).  For a discussion of the effect of "
5207 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
5208 "see B<fcntl>(2)."
5209 msgstr ""
5210
5211 #. type: TP
5212 #: build/C/man2/open.2:443
5213 #, no-wrap
5214 msgid "B<O_PATH> (since Linux 2.6.39)"
5215 msgstr ""
5216
5217 #.  commit 1abf0c718f15a56a0a435588d1b104c7a37dc9bd
5218 #.  commit 326be7b484843988afe57566b627fb7a70beac56
5219 #.  commit 65cfc6722361570bfe255698d9cd4dccaf47570d
5220 #
5221 #.  http://thread.gmane.org/gmane.linux.man/2790/focus=3496
5222 #.      Subject: Re: [PATCH] open(2): document O_PATH
5223 #.      Newsgroups: gmane.linux.man, gmane.linux.kernel
5224 #. type: Plain text
5225 #: build/C/man2/open.2:464
5226 msgid ""
5227 "Obtain a file descriptor that can be used for two purposes: to indicate a "
5228 "location in the file-system tree and to perform operations that act purely "
5229 "at the file descriptor level.  The file itself is not opened, and other file "
5230 "operations (e.g., B<read>(2), B<write>(2), B<fchmod>(2), B<fchown>(2), "
5231 "B<fgetxattr>(2))  fail with the error B<EBADF>."
5232 msgstr ""
5233
5234 #. type: Plain text
5235 #: build/C/man2/open.2:468
5236 msgid ""
5237 "The following operations I<can> be performed on the resulting file "
5238 "descriptor:"
5239 msgstr ""
5240
5241 #.  commit 332a2e1244bd08b9e3ecd378028513396a004a24
5242 #.  fstat(): commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2
5243 #. type: Plain text
5244 #: build/C/man2/open.2:477
5245 msgid ""
5246 "B<close>(2); B<fchdir>(2)  (since Linux 3.5); B<fstat>(2)  (since Linux "
5247 "3.6)."
5248 msgstr ""
5249
5250 #. type: Plain text
5251 #: build/C/man2/open.2:483
5252 msgid "Duplicating the file descriptor (B<dup>(2), B<fcntl>(2)  B<F_DUPFD>, etc.)."
5253 msgstr ""
5254
5255 #. type: Plain text
5256 #: build/C/man2/open.2:489
5257 msgid ""
5258 "Getting and setting file descriptor flags (B<fcntl>(2)  B<F_GETFD> and "
5259 "B<F_SETFD>)."
5260 msgstr ""
5261
5262 #. type: Plain text
5263 #: build/C/man2/open.2:495
5264 msgid ""
5265 "Retrieving open file status flags using the B<fcntl>(2)  B<F_GETFL> "
5266 "operation: the returned flags will include the bit B<O_PATH>."
5267 msgstr ""
5268
5269 #. type: Plain text
5270 #: build/C/man2/open.2:502
5271 msgid ""
5272 "Passing the file descriptor as the I<dirfd> argument of B<openat>(2)  and "
5273 "the other \"*at()\" system calls."
5274 msgstr ""
5275
5276 #. type: Plain text
5277 #: build/C/man2/open.2:508
5278 msgid ""
5279 "Passing the file descriptor to another process via a UNIX domain socket (see "
5280 "B<SCM_RIGHTS> in B<unix>(7))."
5281 msgstr ""
5282
5283 #. type: Plain text
5284 #: build/C/man2/open.2:519
5285 msgid ""
5286 "When B<O_PATH> is specified in I<flags>, flag bits other than B<O_DIRECTORY> "
5287 "and B<O_NOFOLLOW> are ignored."
5288 msgstr ""
5289
5290 #. type: Plain text
5291 #: build/C/man2/open.2:533
5292 msgid ""
5293 "If the B<O_NOFOLLOW> flag is also specified, then the call returns a file "
5294 "descriptor referring to the symbolic link.  This file descriptor can be used "
5295 "as the I<dirfd> argument in calls to B<fchownat>(2), B<fstatat>(2), "
5296 "B<linkat>(2), and B<readlinkat>(2)  with an empty pathname to have the calls "
5297 "operate on the symbolic link."
5298 msgstr ""
5299
5300 #. type: TP
5301 #: build/C/man2/open.2:533
5302 #, no-wrap
5303 msgid "B<O_SYNC>"
5304 msgstr ""
5305
5306 #. type: Plain text
5307 #: build/C/man2/open.2:541
5308 msgid ""
5309 "The file is opened for synchronous I/O.  Any B<write>(2)s on the resulting "
5310 "file descriptor will block the calling process until the data has been "
5311 "physically written to the underlying hardware.  I<But see NOTES below>."
5312 msgstr ""
5313
5314 #. type: TP
5315 #: build/C/man2/open.2:541
5316 #, no-wrap
5317 msgid "B<O_TRUNC>"
5318 msgstr ""
5319
5320 #. type: Plain text
5321 #: build/C/man2/open.2:555
5322 msgid ""
5323 "If the file already exists and is a regular file and the open mode allows "
5324 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>)  it will be truncated to length "
5325 "0.  If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
5326 "ignored.  Otherwise the effect of B<O_TRUNC> is unspecified."
5327 msgstr ""
5328
5329 #. type: Plain text
5330 #: build/C/man2/open.2:559
5331 msgid ""
5332 "Some of these optional flags can be altered using B<fcntl>(2)  after the "
5333 "file has been opened."
5334 msgstr ""
5335
5336 #. type: Plain text
5337 #: build/C/man2/open.2:567
5338 msgid ""
5339 "B<creat>()  is equivalent to B<open>()  with I<flags> equal to "
5340 "B<O_CREAT|O_WRONLY|O_TRUNC>."
5341 msgstr ""
5342
5343 #. type: Plain text
5344 #: build/C/man2/open.2:575
5345 msgid ""
5346 "B<open>()  and B<creat>()  return the new file descriptor, or -1 if an error "
5347 "occurred (in which case, I<errno> is set appropriately)."
5348 msgstr ""
5349
5350 #. type: Plain text
5351 #: build/C/man2/open.2:585
5352 msgid ""
5353 "The requested access to the file is not allowed, or search permission is "
5354 "denied for one of the directories in the path prefix of I<pathname>, or the "
5355 "file did not exist yet and write access to the parent directory is not "
5356 "allowed.  (See also B<path_resolution>(7).)"
5357 msgstr ""
5358
5359 #. type: Plain text
5360 #: build/C/man2/open.2:591
5361 msgid ""
5362 "Where B<O_CREAT> is specified, the file does not exist, and the user's quota "
5363 "of disk blocks or inodes on the file system has been exhausted."
5364 msgstr ""
5365
5366 #. type: Plain text
5367 #: build/C/man2/open.2:597
5368 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
5369 msgstr ""
5370
5371 #. type: Plain text
5372 #: build/C/man2/open.2:601 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:84
5373 msgid "I<pathname> points outside your accessible address space."
5374 msgstr ""
5375
5376 #. type: TP
5377 #: build/C/man2/open.2:601 build/C/man2/write.2:145
5378 #, no-wrap
5379 msgid "B<EFBIG>"
5380 msgstr ""
5381
5382 #. type: Plain text
5383 #: build/C/man2/open.2:605
5384 msgid "See B<EOVERFLOW>."
5385 msgstr ""
5386
5387 #. type: TP
5388 #: build/C/man2/open.2:605 build/C/man2/read.2:122 build/C/man3/scanf.3:561 build/C/man3/tmpfile.3:63 build/C/man2/write.2:150
5389 #, no-wrap
5390 msgid "B<EINTR>"
5391 msgstr ""
5392
5393 #. type: Plain text
5394 #: build/C/man2/open.2:612
5395 msgid ""
5396 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
5397 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
5398 "B<signal>(7)."
5399 msgstr ""
5400
5401 #. type: TP
5402 #: build/C/man2/open.2:612 build/C/man2/read.2:158 build/C/man2/rename.2:143 build/C/man2/unlink.2:87
5403 #, no-wrap
5404 msgid "B<EISDIR>"
5405 msgstr ""
5406
5407 #. type: Plain text
5408 #: build/C/man2/open.2:621
5409 msgid ""
5410 "I<pathname> refers to a directory and the access requested involved writing "
5411 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
5412 msgstr ""
5413
5414 #. type: Plain text
5415 #: build/C/man2/open.2:628
5416 msgid ""
5417 "Too many symbolic links were encountered in resolving I<pathname>, or "
5418 "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
5419 msgstr ""
5420
5421 #. type: TP
5422 #: build/C/man2/open.2:628 build/C/man2/pipe.2:107 build/C/man3/tmpfile.3:66
5423 #, no-wrap
5424 msgid "B<EMFILE>"
5425 msgstr ""
5426
5427 #. type: Plain text
5428 #: build/C/man2/open.2:631
5429 msgid "The process already has the maximum number of files open."
5430 msgstr ""
5431
5432 #. type: Plain text
5433 #: build/C/man2/open.2:635 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:99
5434 msgid "I<pathname> was too long."
5435 msgstr ""
5436
5437 #. type: TP
5438 #: build/C/man2/open.2:635 build/C/man2/pipe.2:110 build/C/man3/tmpfile.3:69
5439 #, no-wrap
5440 msgid "B<ENFILE>"
5441 msgstr ""
5442
5443 #. type: Plain text
5444 #: build/C/man2/open.2:638 build/C/man2/pipe.2:113
5445 msgid "The system limit on the total number of open files has been reached."
5446 msgstr ""
5447
5448 #. type: TP
5449 #: build/C/man2/open.2:638
5450 #, no-wrap
5451 msgid "B<ENODEV>"
5452 msgstr ""
5453
5454 #. type: Plain text
5455 #: build/C/man2/open.2:645
5456 msgid ""
5457 "I<pathname> refers to a device special file and no corresponding device "
5458 "exists.  (This is a Linux kernel bug; in this situation B<ENXIO> must be "
5459 "returned.)"
5460 msgstr ""
5461
5462 #. type: Plain text
5463 #: build/C/man2/open.2:652
5464 msgid ""
5465 "B<O_CREAT> is not set and the named file does not exist.  Or, a directory "
5466 "component in I<pathname> does not exist or is a dangling symbolic link."
5467 msgstr ""
5468
5469 #. type: Plain text
5470 #: build/C/man2/open.2:661
5471 msgid ""
5472 "I<pathname> was to be created but the device containing I<pathname> has no "
5473 "room for the new file."
5474 msgstr ""
5475
5476 #. type: Plain text
5477 #: build/C/man2/open.2:668
5478 msgid ""
5479 "A component used as a directory in I<pathname> is not, in fact, a directory, "
5480 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
5481 msgstr ""
5482
5483 #. type: Plain text
5484 #: build/C/man2/open.2:674
5485 msgid ""
5486 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO and no process "
5487 "has the file open for reading.  Or, the file is a device special file and no "
5488 "corresponding device exists."
5489 msgstr ""
5490
5491 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=7253
5492 #.  "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
5493 #.  Reported 2006-10-03
5494 #. type: Plain text
5495 #: build/C/man2/open.2:694
5496 msgid ""
5497 "I<pathname> refers to a regular file that is too large to be opened.  The "
5498 "usual scenario here is that an application compiled on a 32-bit platform "
5499 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
5500 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above.  This is the error "
5501 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
5502 "B<EFBIG> for this case."
5503 msgstr ""
5504
5505 #.  Strictly speaking, it's the file system UID... (MTK)
5506 #. type: Plain text
5507 #: build/C/man2/open.2:702
5508 msgid ""
5509 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
5510 "did not match the owner of the file and the caller was not privileged "
5511 "(B<CAP_FOWNER>)."
5512 msgstr ""
5513
5514 #. type: Plain text
5515 #: build/C/man2/open.2:707
5516 msgid ""
5517 "I<pathname> refers to a file on a read-only file system and write access was "
5518 "requested."
5519 msgstr ""
5520
5521 #. type: TP
5522 #: build/C/man2/open.2:707
5523 #, no-wrap
5524 msgid "B<ETXTBSY>"
5525 msgstr ""
5526
5527 #. type: Plain text
5528 #: build/C/man2/open.2:712
5529 msgid ""
5530 "I<pathname> refers to an executable image which is currently being executed "
5531 "and write access was requested."
5532 msgstr ""
5533
5534 #. type: TP
5535 #: build/C/man2/open.2:712
5536 #, no-wrap
5537 msgid "B<EWOULDBLOCK>"
5538 msgstr ""
5539
5540 #. type: Plain text
5541 #: build/C/man2/open.2:719
5542 msgid ""
5543 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
5544 "the file (see B<fcntl>(2))."
5545 msgstr ""
5546
5547 #. type: Plain text
5548 #: build/C/man2/open.2:733
5549 msgid ""
5550 "SVr4, 4.3BSD, POSIX.1-2001.  The B<O_DIRECTORY>, B<O_NOATIME>, "
5551 "B<O_NOFOLLOW>, and B<O_PATH> flags are Linux-specific, and one may need to "
5552 "define B<_GNU_SOURCE> (before including I<any> header files)  to obtain "
5553 "their definitions."
5554 msgstr ""
5555
5556 #. type: Plain text
5557 #: build/C/man2/open.2:738
5558 msgid ""
5559 "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified in "
5560 "POSIX.1-2008."
5561 msgstr ""
5562
5563 #. type: Plain text
5564 #: build/C/man2/open.2:746
5565 msgid ""
5566 "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
5567 "(before including I<any> header files)  to get its definition."
5568 msgstr ""
5569
5570 #. type: Plain text
5571 #: build/C/man2/open.2:754
5572 msgid ""
5573 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
5574 "does not necessarily have the intention to read or write.  This is typically "
5575 "used to open devices in order to get a file descriptor for use with "
5576 "B<ioctl>(2)."
5577 msgstr ""
5578
5579 #.  See for example util-linux's disk-utils/setfdprm.c
5580 #.  For some background on access mode 3, see
5581 #.  http://thread.gmane.org/gmane.linux.kernel/653123
5582 #.  "[RFC] correct flags to f_mode conversion in __dentry_open"
5583 #.  LKML, 12 Mar 2008
5584 #. type: Plain text
5585 #: build/C/man2/open.2:783
5586 msgid ""
5587 "Unlike the other values that can be specified in I<flags>, the I<access "
5588 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR>, do not specify "
5589 "individual bits.  Rather, they define the low order two bits of I<flags>, "
5590 "and are defined respectively as 0, 1, and 2.  In other words, the "
5591 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
5592 "not have the same meaning as B<O_RDWR>.  Linux reserves the special, "
5593 "nonstandard access mode 3 (binary 11) in I<flags> to mean: check for read "
5594 "and write permission on the file and return a descriptor that can't be used "
5595 "for reading or writing.  This nonstandard access mode is used by some Linux "
5596 "drivers to return a descriptor that is to be used only for device-specific "
5597 "B<ioctl>(2)  operations."
5598 msgstr ""
5599
5600 #.  Linux 2.0, 2.5: truncate
5601 #.  Solaris 5.7, 5.8: truncate
5602 #.  Irix 6.5: truncate
5603 #.  Tru64 5.1B: truncate
5604 #.  HP-UX 11.22: truncate
5605 #.  FreeBSD 4.7: truncate
5606 #. type: Plain text
5607 #: build/C/man2/open.2:794
5608 msgid ""
5609 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
5610 "implementations.  On many systems the file is actually truncated."
5611 msgstr ""
5612
5613 #. type: Plain text
5614 #: build/C/man2/open.2:798
5615 msgid ""
5616 "There are many infelicities in the protocol underlying NFS, affecting "
5617 "amongst others B<O_SYNC> and B<O_NDELAY>."
5618 msgstr ""
5619
5620 #. type: Plain text
5621 #: build/C/man2/open.2:820
5622 msgid ""
5623 "POSIX provides for three different variants of synchronized I/O, "
5624 "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>.  Currently "
5625 "(2.6.31), Linux implements only B<O_SYNC>, but glibc maps B<O_DSYNC> and "
5626 "B<O_RSYNC> to the same numerical value as B<O_SYNC>.  Most Linux file "
5627 "systems don't actually implement the POSIX B<O_SYNC> semantics, which "
5628 "require all metadata updates of a write to be on disk on returning to user "
5629 "space, but only the B<O_DSYNC> semantics, which require only actual file "
5630 "data and metadata necessary to retrieve it to be on disk by the time the "
5631 "system call returns."
5632 msgstr ""
5633
5634 #. type: Plain text
5635 #: build/C/man2/open.2:828
5636 msgid ""
5637 "Note that B<open>()  can open device special files, but B<creat>()  cannot "
5638 "create them; use B<mknod>(2)  instead."
5639 msgstr ""
5640
5641 #. type: Plain text
5642 #: build/C/man2/open.2:841
5643 msgid ""
5644 "On NFS file systems with UID mapping enabled, B<open>()  may return a file "
5645 "descriptor but, for example, B<read>(2)  requests are denied with "
5646 "B<EACCES>.  This is because the client performs B<open>()  by checking the "
5647 "permissions, but UID mapping is performed by the server upon read and write "
5648 "requests."
5649 msgstr ""
5650
5651 #. type: Plain text
5652 #: build/C/man2/open.2:860
5653 msgid ""
5654 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
5655 "fields (respectively, time of last access, time of last status change, and "
5656 "time of last modification; see B<stat>(2))  are set to the current time, and "
5657 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory.  "
5658 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
5659 "st_ctime and st_mtime fields are set to the current time."
5660 msgstr ""
5661
5662 #. type: SS
5663 #: build/C/man2/open.2:860
5664 #, no-wrap
5665 msgid "O_DIRECT"
5666 msgstr ""
5667
5668 #. type: Plain text
5669 #: build/C/man2/open.2:877
5670 msgid ""
5671 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
5672 "address of user-space buffers and the file offset of I/Os.  In Linux "
5673 "alignment restrictions vary by file system and kernel version and might be "
5674 "absent entirely.  However there is currently no file system-independent "
5675 "interface for an application to discover these restrictions for a given file "
5676 "or file system.  Some file systems provide their own interfaces for doing "
5677 "so, for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
5678 msgstr ""
5679
5680 #. type: Plain text
5681 #: build/C/man2/open.2:882
5682 msgid ""
5683 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
5684 "the file offset must all be multiples of the logical block size of the file "
5685 "system.  Under Linux 2.6, alignment to 512-byte boundaries suffices."
5686 msgstr ""
5687
5688 #. type: Plain text
5689 #: build/C/man2/open.2:916
5690 msgid ""
5691 "B<O_DIRECT> I/Os should never be run concurrently with the B<fork>(2)  "
5692 "system call, if the memory buffer is a private mapping (i.e., any mapping "
5693 "created with the B<mmap>(2)  B<MAP_PRIVATE> flag; this includes memory "
5694 "allocated on the heap and statically allocated buffers).  Any such I/Os, "
5695 "whether submitted via an asynchronous I/O interface or from another thread "
5696 "in the process, should be completed before B<fork>(2)  is called.  Failure "
5697 "to do so can result in data corruption and undefined behavior in parent and "
5698 "child processes.  This restriction does not apply when the memory buffer for "
5699 "the B<O_DIRECT> I/Os was created using B<shmat>(2)  or B<mmap>(2)  with the "
5700 "B<MAP_SHARED> flag.  Nor does this restriction apply when the memory buffer "
5701 "has been advised as B<MADV_DONTFORK> with B<madvise>(2), ensuring that it "
5702 "will not be available to the child after B<fork>(2)."
5703 msgstr ""
5704
5705 #. type: Plain text
5706 #: build/C/man2/open.2:926
5707 msgid ""
5708 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
5709 "restrictions similar to those of Linux 2.4.  IRIX has also a B<fcntl>(2)  "
5710 "call to query appropriate alignments, and sizes.  FreeBSD 4.x introduced a "
5711 "flag of the same name, but without alignment restrictions."
5712 msgstr ""
5713
5714 #. type: Plain text
5715 #: build/C/man2/open.2:935
5716 msgid ""
5717 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10.  Older "
5718 "Linux kernels simply ignore this flag.  Some file systems may not implement "
5719 "the flag and B<open>()  will fail with B<EINVAL> if it is used."
5720 msgstr ""
5721
5722 #. type: Plain text
5723 #: build/C/man2/open.2:946
5724 msgid ""
5725 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
5726 "file, and especially to overlapping byte regions in the same file.  Even "
5727 "when the file system correctly handles the coherency issues in this "
5728 "situation, overall I/O throughput is likely to be slower than using either "
5729 "mode alone.  Likewise, applications should avoid mixing B<mmap>(2)  of files "
5730 "with direct I/O to the same files."
5731 msgstr ""
5732
5733 #. type: Plain text
5734 #: build/C/man2/open.2:968
5735 msgid ""
5736 "The behaviour of B<O_DIRECT> with NFS will differ from local file systems.  "
5737 "Older kernels, or kernels configured in certain ways, may not support this "
5738 "combination.  The NFS protocol does not support passing the flag to the "
5739 "server, so B<O_DIRECT> I/O will bypass the page cache only on the client; "
5740 "the server may still cache the I/O.  The client asks the server to make the "
5741 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>.  Some "
5742 "servers will perform poorly under these circumstances, especially if the I/O "
5743 "size is small.  Some servers may also be configured to lie to clients about "
5744 "the I/O having reached stable storage; this will avoid the performance "
5745 "penalty at some risk to data integrity in the event of server power "
5746 "failure.  The Linux NFS client places no alignment restrictions on "
5747 "B<O_DIRECT> I/O."
5748 msgstr ""
5749
5750 #. type: Plain text
5751 #: build/C/man2/open.2:975
5752 msgid ""
5753 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
5754 "with caution.  It is recommended that applications treat use of B<O_DIRECT> "
5755 "as a performance option which is disabled by default."
5756 msgstr ""
5757
5758 #. type: Plain text
5759 #: build/C/man2/open.2:980
5760 msgid ""
5761 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
5762 "interface is just stupid, and was probably designed by a deranged monkey on "
5763 "some serious mind-controlling substances.\"\\(emLinus"
5764 msgstr ""
5765
5766 #.  FIXME . Check bugzilla report on open(O_ASYNC)
5767 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=5993
5768 #. type: Plain text
5769 #: build/C/man2/open.2:992
5770 msgid ""
5771 "Currently, it is not possible to enable signal-driven I/O by specifying "
5772 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2)  to enable this flag."
5773 msgstr ""
5774
5775 #. type: Plain text
5776 #: build/C/man2/open.2:1014
5777 msgid ""
5778 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
5779 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<openat>(2), B<read>(2), "
5780 "B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), B<write>(2), "
5781 "B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
5782 msgstr ""
5783
5784 #. type: TH
5785 #: build/C/man3/perror.3:31
5786 #, no-wrap
5787 msgid "PERROR"
5788 msgstr ""
5789
5790 #. type: TH
5791 #: build/C/man3/perror.3:31
5792 #, no-wrap
5793 msgid "2012-04-17"
5794 msgstr ""
5795
5796 #. type: Plain text
5797 #: build/C/man3/perror.3:34
5798 msgid "perror - print a system error message"
5799 msgstr ""
5800
5801 #. type: Plain text
5802 #: build/C/man3/perror.3:38
5803 msgid "B<void perror(const char *>I<s>B<);>"
5804 msgstr ""
5805
5806 #. type: Plain text
5807 #: build/C/man3/perror.3:40
5808 msgid "B<#include E<lt>errno.hE<gt>>"
5809 msgstr ""
5810
5811 #. type: Plain text
5812 #: build/C/man3/perror.3:42
5813 msgid "B<const char *>I<sys_errlist>B<[];>"
5814 msgstr ""
5815
5816 #. type: Plain text
5817 #: build/C/man3/perror.3:44
5818 msgid "B<int >I<sys_nerr>B<;>"
5819 msgstr ""
5820
5821 #. type: Plain text
5822 #: build/C/man3/perror.3:46
5823 msgid "B<int >I<errno>B<;>"
5824 msgstr ""
5825
5826 #. type: Plain text
5827 #: build/C/man3/perror.3:55
5828 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
5829 msgstr ""
5830
5831 #. type: Plain text
5832 #: build/C/man3/perror.3:68
5833 msgid ""
5834 "The routine B<perror>()  produces a message on the standard error output, "
5835 "describing the last error encountered during a call to a system or library "
5836 "function.  First (if I<s> is not NULL and I<*s> is not a null byte "
5837 "(\\(aq\\e0\\(aq)) the argument string I<s> is printed, followed by a colon "
5838 "and a blank.  Then the message and a new-line."
5839 msgstr ""
5840
5841 #. type: Plain text
5842 #: build/C/man3/perror.3:76
5843 msgid ""
5844 "To be of most use, the argument string should include the name of the "
5845 "function that incurred the error.  The error number is taken from the "
5846 "external variable I<errno>, which is set when errors occur but not cleared "
5847 "when successful calls are made."
5848 msgstr ""
5849
5850 #. type: Plain text
5851 #: build/C/man3/perror.3:90
5852 msgid ""
5853 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
5854 "obtain the error message without the newline.  The largest message number "
5855 "provided in the table is I<sys_nerr>-1.  Be careful when directly accessing "
5856 "this list because new error values may not have been added to "
5857 "I<sys_errlist>[].  The use of I<sys_errlist>[] is nowadays deprecated."
5858 msgstr ""
5859
5860 #. type: Plain text
5861 #: build/C/man3/perror.3:111
5862 msgid ""
5863 "When a system call fails, it usually returns -1 and sets the variable "
5864 "I<errno> to a value describing what went wrong.  (These values can be found "
5865 "in I<E<lt>errno.hE<gt>>.)  Many library functions do likewise.  The function "
5866 "B<perror>()  serves to translate this error code into human-readable form.  "
5867 "Note that I<errno> is undefined after a successful library call: this call "
5868 "may well change this variable, even though it succeeds, for example because "
5869 "it internally used some other library function that failed.  Thus, if a "
5870 "failing call is not immediately followed by a call to B<perror>(), the value "
5871 "of I<errno> should be saved."
5872 msgstr ""
5873
5874 #. type: Plain text
5875 #: build/C/man3/perror.3:124
5876 msgid ""
5877 "The function B<perror>()  and the external I<errno> (see B<errno>(3))  "
5878 "conform to C89, C99, 4.3BSD, POSIX.1-2001.  The externals I<sys_nerr> and "
5879 "I<sys_errlist> conform to BSD."
5880 msgstr ""
5881
5882 #.  and only when _BSD_SOURCE is defined.
5883 #.  When
5884 #.  .B _GNU_SOURCE
5885 #.  is defined, the symbols
5886 #.  .I _sys_nerr
5887 #.  and
5888 #.  .I _sys_errlist
5889 #.  are provided.
5890 #. type: Plain text
5891 #: build/C/man3/perror.3:139
5892 msgid ""
5893 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
5894 "I<E<lt>stdio.hE<gt>>."
5895 msgstr ""
5896
5897 #. type: Plain text
5898 #: build/C/man3/perror.3:144
5899 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
5900 msgstr ""
5901
5902 #. type: TH
5903 #: build/C/man2/pipe.2:36
5904 #, no-wrap
5905 msgid "PIPE"
5906 msgstr ""
5907
5908 #. type: TH
5909 #: build/C/man2/pipe.2:36
5910 #, no-wrap
5911 msgid "2012-02-14"
5912 msgstr ""
5913
5914 #. type: Plain text
5915 #: build/C/man2/pipe.2:39
5916 msgid "pipe, pipe2 - create pipe"
5917 msgstr ""
5918
5919 #. type: Plain text
5920 #: build/C/man2/pipe.2:42 build/C/man2/read.2:41
5921 #, no-wrap
5922 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5923 msgstr ""
5924
5925 #. type: Plain text
5926 #: build/C/man2/pipe.2:44
5927 #, no-wrap
5928 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
5929 msgstr ""
5930
5931 #. type: Plain text
5932 #: build/C/man2/pipe.2:48
5933 #, no-wrap
5934 msgid ""
5935 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
5936 "B<#include E<lt>fcntl.hE<gt>>              /* Obtain O_* constant "
5937 "definitions */\n"
5938 "B<#include E<lt>unistd.hE<gt>>\n"
5939 msgstr ""
5940
5941 #. type: Plain text
5942 #: build/C/man2/pipe.2:50
5943 #, no-wrap
5944 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
5945 msgstr ""
5946
5947 #. type: Plain text
5948 #: build/C/man2/pipe.2:66
5949 msgid ""
5950 "B<pipe>()  creates a pipe, a unidirectional data channel that can be used "
5951 "for interprocess communication.  The array I<pipefd> is used to return two "
5952 "file descriptors referring to the ends of the pipe.  I<pipefd[0]> refers to "
5953 "the read end of the pipe.  I<pipefd[1]> refers to the write end of the "
5954 "pipe.  Data written to the write end of the pipe is buffered by the kernel "
5955 "until it is read from the read end of the pipe.  For further details, see "
5956 "B<pipe>(7)."
5957 msgstr ""
5958
5959 #. type: Plain text
5960 #: build/C/man2/pipe.2:76
5961 msgid ""
5962 "If I<flags> is 0, then B<pipe2>()  is the same as B<pipe>().  The following "
5963 "values can be bitwise ORed in I<flags> to obtain different behavior:"
5964 msgstr ""
5965
5966 #. type: TP
5967 #: build/C/man2/pipe.2:76
5968 #, no-wrap
5969 msgid "B<O_NONBLOCK>"
5970 msgstr ""
5971
5972 #. type: Plain text
5973 #: build/C/man2/pipe.2:84
5974 msgid ""
5975 "Set the B<O_NONBLOCK> file status flag on the two new open file "
5976 "descriptions.  Using this flag saves extra calls to B<fcntl>(2)  to achieve "
5977 "the same result."
5978 msgstr ""
5979
5980 #. type: TP
5981 #: build/C/man2/pipe.2:84
5982 #, no-wrap
5983 msgid "B<O_CLOEXEC>"
5984 msgstr ""
5985
5986 #. type: Plain text
5987 #: build/C/man2/pipe.2:92
5988 msgid ""
5989 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the two new file "
5990 "descriptors.  See the description of the same flag in B<open>(2)  for "
5991 "reasons why this may be useful."
5992 msgstr ""
5993
5994 #. type: Plain text
5995 #: build/C/man2/pipe.2:102
5996 msgid "I<pipefd> is not valid."
5997 msgstr ""
5998
5999 #. type: Plain text
6000 #: build/C/man2/pipe.2:107
6001 msgid "(B<pipe2>())  Invalid value in I<flags>."
6002 msgstr ""
6003
6004 #. type: Plain text
6005 #: build/C/man2/pipe.2:110
6006 msgid "Too many file descriptors are in use by the process."
6007 msgstr ""
6008
6009 #. type: Plain text
6010 #: build/C/man2/pipe.2:118
6011 msgid ""
6012 "B<pipe2>()  was added to Linux in version 2.6.27; glibc support is available "
6013 "starting with version 2.9."
6014 msgstr ""
6015
6016 #. type: Plain text
6017 #: build/C/man2/pipe.2:121
6018 msgid "B<pipe>(): POSIX.1-2001."
6019 msgstr ""
6020
6021 #. type: Plain text
6022 #: build/C/man2/pipe.2:124
6023 msgid "B<pipe2>()  is Linux-specific."
6024 msgstr ""
6025
6026 #.  fork.2 refers to this example program.
6027 #. type: Plain text
6028 #: build/C/man2/pipe.2:140
6029 msgid ""
6030 "The following program creates a pipe, and then B<fork>(2)s to create a child "
6031 "process; the child inherits a duplicate set of file descriptors that refer "
6032 "to the same pipe.  After the B<fork>(2), each process closes the descriptors "
6033 "that it doesn't need for the pipe (see B<pipe>(7)).  The parent then writes "
6034 "the string contained in the program's command-line argument to the pipe, and "
6035 "the child reads this string a byte at a time from the pipe and echoes it on "
6036 "standard output."
6037 msgstr ""
6038
6039 #. type: Plain text
6040 #: build/C/man2/pipe.2:147
6041 #, no-wrap
6042 msgid ""
6043 "#include E<lt>sys/wait.hE<gt>\n"
6044 "#include E<lt>stdio.hE<gt>\n"
6045 "#include E<lt>stdlib.hE<gt>\n"
6046 "#include E<lt>unistd.hE<gt>\n"
6047 "#include E<lt>string.hE<gt>\n"
6048 msgstr ""
6049
6050 #. type: Plain text
6051 #: build/C/man2/pipe.2:154
6052 #, no-wrap
6053 msgid ""
6054 "int\n"
6055 "main(int argc, char *argv[])\n"
6056 "{\n"
6057 "    int pipefd[2];\n"
6058 "    pid_t cpid;\n"
6059 "    char buf;\n"
6060 msgstr ""
6061
6062 #. type: Plain text
6063 #: build/C/man2/pipe.2:159
6064 #, no-wrap
6065 msgid ""
6066 "    if (argc != 2) {\n"
6067 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
6068 "\texit(EXIT_FAILURE);\n"
6069 "    }\n"
6070 msgstr ""
6071
6072 #. type: Plain text
6073 #: build/C/man2/pipe.2:164
6074 #, no-wrap
6075 msgid ""
6076 "    if (pipe(pipefd) == -1) {\n"
6077 "        perror(\"pipe\");\n"
6078 "        exit(EXIT_FAILURE);\n"
6079 "    }\n"
6080 msgstr ""
6081
6082 #. type: Plain text
6083 #: build/C/man2/pipe.2:170
6084 #, no-wrap
6085 msgid ""
6086 "    cpid = fork();\n"
6087 "    if (cpid == -1) {\n"
6088 "        perror(\"fork\");\n"
6089 "        exit(EXIT_FAILURE);\n"
6090 "    }\n"
6091 msgstr ""
6092
6093 #. type: Plain text
6094 #: build/C/man2/pipe.2:173
6095 #, no-wrap
6096 msgid ""
6097 "    if (cpid == 0) {    /* Child reads from pipe */\n"
6098 "        close(pipefd[1]);          /* Close unused write end */\n"
6099 msgstr ""
6100
6101 #. type: Plain text
6102 #: build/C/man2/pipe.2:176
6103 #, no-wrap
6104 msgid ""
6105 "        while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
6106 "            write(STDOUT_FILENO, &buf, 1);\n"
6107 msgstr ""
6108
6109 #. type: Plain text
6110 #: build/C/man2/pipe.2:180
6111 #, no-wrap
6112 msgid ""
6113 "        write(STDOUT_FILENO, \"\\en\", 1);\n"
6114 "        close(pipefd[0]);\n"
6115 "        _exit(EXIT_SUCCESS);\n"
6116 msgstr ""
6117
6118 #. type: Plain text
6119 #: build/C/man2/pipe.2:189
6120 #, no-wrap
6121 msgid ""
6122 "    } else {            /* Parent writes argv[1] to pipe */\n"
6123 "        close(pipefd[0]);          /* Close unused read end */\n"
6124 "        write(pipefd[1], argv[1], strlen(argv[1]));\n"
6125 "        close(pipefd[1]);          /* Reader will see EOF */\n"
6126 "        wait(NULL);                /* Wait for child */\n"
6127 "        exit(EXIT_SUCCESS);\n"
6128 "    }\n"
6129 "}\n"
6130 msgstr ""
6131
6132 #. type: Plain text
6133 #: build/C/man2/pipe.2:197
6134 msgid ""
6135 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
6136 "B<pipe>(7)"
6137 msgstr ""
6138
6139 #. type: TH
6140 #: build/C/man3/popen.3:40
6141 #, no-wrap
6142 msgid "POPEN"
6143 msgstr ""
6144
6145 #. type: Plain text
6146 #: build/C/man3/popen.3:43
6147 msgid "popen, pclose - pipe stream to or from a process"
6148 msgstr ""
6149
6150 #. type: Plain text
6151 #: build/C/man3/popen.3:48
6152 #, no-wrap
6153 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
6154 msgstr ""
6155
6156 #. type: Plain text
6157 #: build/C/man3/popen.3:50
6158 #, no-wrap
6159 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
6160 msgstr ""
6161
6162 #. type: Plain text
6163 #: build/C/man3/popen.3:60
6164 msgid "B<popen>(), B<pclose>():"
6165 msgstr ""
6166
6167 #. type: Plain text
6168 #: build/C/man3/popen.3:62
6169 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
6170 msgstr ""
6171
6172 #. type: Plain text
6173 #: build/C/man3/popen.3:73
6174 msgid ""
6175 "The B<popen>()  function opens a process by creating a pipe, forking, and "
6176 "invoking the shell.  Since a pipe is by definition unidirectional, the "
6177 "I<type> argument may specify only reading or writing, not both; the "
6178 "resulting stream is correspondingly read-only or write-only."
6179 msgstr ""
6180
6181 #. type: Plain text
6182 #: build/C/man3/popen.3:97
6183 msgid ""
6184 "The I<command> argument is a pointer to a null-terminated string containing "
6185 "a shell command line.  This command is passed to I</bin/sh> using the B<-c> "
6186 "flag; interpretation, if any, is performed by the shell.  The I<type> "
6187 "argument is a pointer to a null-terminated string which must contain either "
6188 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing.  "
6189 "Since glibc 2.9, this argument can additionally include the letter "
6190 "\\(aqe\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>)  to be set "
6191 "on the underlying file descriptor; see the description of the B<O_CLOEXEC> "
6192 "flag in B<open>(2)  for reasons why this may be useful."
6193 msgstr ""
6194
6195 #. type: Plain text
6196 #: build/C/man3/popen.3:113
6197 msgid ""
6198 "The return value from B<popen>()  is a normal standard I/O stream in all "
6199 "respects save that it must be closed with B<pclose>()  rather than "
6200 "B<fclose>(3).  Writing to such a stream writes to the standard input of the "
6201 "command; the command's standard output is the same as that of the process "
6202 "that called B<popen>(), unless this is altered by the command itself.  "
6203 "Conversely, reading from a \"popened\" stream reads the command's standard "
6204 "output, and the command's standard input is the same as that of the process "
6205 "that called B<popen>()."
6206 msgstr ""
6207
6208 #. type: Plain text
6209 #: build/C/man3/popen.3:117
6210 msgid "Note that output B<popen>()  streams are fully buffered by default."
6211 msgstr ""
6212
6213 #. type: Plain text
6214 #: build/C/man3/popen.3:123
6215 msgid ""
6216 "The B<pclose>()  function waits for the associated process to terminate and "
6217 "returns the exit status of the command as returned by B<wait4>(2)."
6218 msgstr ""
6219
6220 #. type: Plain text
6221 #: build/C/man3/popen.3:131
6222 msgid ""
6223 "The B<popen>()  function returns NULL if the B<fork>(2)  or B<pipe>(2)  "
6224 "calls fail, or if it cannot allocate memory."
6225 msgstr ""
6226
6227 #.  These conditions actually give undefined results, so I commented
6228 #.  them out.
6229 #.  .I stream
6230 #.  is not associated with a "popen()ed" command, if
6231 #. .I stream
6232 #.  already "pclose()d", or if
6233 #. type: Plain text
6234 #: build/C/man3/popen.3:146
6235 msgid ""
6236 "The B<pclose>()  function returns -1 if B<wait4>(2)  returns an error, or "
6237 "some other error is detected.  In the event of an error, these functions set "
6238 "I<errnro> to indicate the cause of the error."
6239 msgstr ""
6240
6241 #. type: Plain text
6242 #: build/C/man3/popen.3:165
6243 msgid ""
6244 "The B<popen>()  function does not set I<errno> if memory allocation fails.  "
6245 "If the underlying B<fork>(2)  or B<pipe>(2)  fails, I<errno> is set "
6246 "appropriately.  If the I<type> argument is invalid, and this condition is "
6247 "detected, I<errno> is set to B<EINVAL>."
6248 msgstr ""
6249
6250 #. type: Plain text
6251 #: build/C/man3/popen.3:172
6252 msgid ""
6253 "If B<pclose>()  cannot obtain the child status, I<errno> is set to "
6254 "B<ECHILD>."
6255 msgstr ""
6256
6257 #. type: Plain text
6258 #: build/C/man3/popen.3:178
6259 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
6260 msgstr ""
6261
6262 #. type: Plain text
6263 #: build/C/man3/popen.3:191
6264 msgid ""
6265 "Since the standard input of a command opened for reading shares its seek "
6266 "offset with the process that called B<popen>(), if the original process has "
6267 "done a buffered read, the command's input position may not be as expected.  "
6268 "Similarly, the output from a command opened for writing may become "
6269 "intermingled with that of the original process.  The latter can be avoided "
6270 "by calling B<fflush>(3)  before B<popen>()."
6271 msgstr ""
6272
6273 #.  .SH HISTORY
6274 #.  A
6275 #.  .BR popen ()
6276 #.  and a
6277 #.  .BR pclose ()
6278 #.  function appeared in Version 7 AT&T UNIX.
6279 #. type: Plain text
6280 #: build/C/man3/popen.3:201
6281 msgid ""
6282 "Failure to execute the shell is indistinguishable from the shell's failure "
6283 "to execute command, or an immediate exit of the command.  The only hint is "
6284 "an exit status of 127."
6285 msgstr ""
6286
6287 #. type: Plain text
6288 #: build/C/man3/popen.3:211
6289 msgid ""
6290 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
6291 "B<fopen>(3), B<stdio>(3), B<system>(3)"
6292 msgstr ""
6293
6294 #. type: TH
6295 #: build/C/man3/printf.3:34
6296 #, no-wrap
6297 msgid "PRINTF"
6298 msgstr ""
6299
6300 #. type: TH
6301 #: build/C/man3/printf.3:34
6302 #, no-wrap
6303 msgid "2013-03-05"
6304 msgstr ""
6305
6306 #. type: Plain text
6307 #: build/C/man3/printf.3:38
6308 msgid ""
6309 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
6310 "formatted output conversion"
6311 msgstr ""
6312
6313 #. type: Plain text
6314 #: build/C/man3/printf.3:42
6315 msgid "B<int printf(const char *>I<format>B<, ...);>"
6316 msgstr ""
6317
6318 #. type: Plain text
6319 #: build/C/man3/printf.3:44
6320 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
6321 msgstr ""
6322
6323 #. type: Plain text
6324 #: build/C/man3/printf.3:46
6325 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
6326 msgstr ""
6327
6328 #. type: Plain text
6329 #: build/C/man3/printf.3:48
6330 msgid ""
6331 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char *>I<format>B<, "
6332 "...);>"
6333 msgstr ""
6334
6335 #. type: Plain text
6336 #: build/C/man3/printf.3:50
6337 msgid "B<#include E<lt>stdarg.hE<gt>>"
6338 msgstr ""
6339
6340 #. type: Plain text
6341 #: build/C/man3/printf.3:52
6342 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
6343 msgstr ""
6344
6345 #. type: Plain text
6346 #: build/C/man3/printf.3:54
6347 msgid ""
6348 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
6349 ">I<ap>B<);>"
6350 msgstr ""
6351
6352 #. type: Plain text
6353 #: build/C/man3/printf.3:56
6354 msgid ""
6355 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list "
6356 ">I<ap>B<);>"
6357 msgstr ""
6358
6359 #. type: Plain text
6360 #: build/C/man3/printf.3:59
6361 msgid ""
6362 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
6363 "*>I<format>B<, va_list >I<ap>B<);>"
6364 msgstr ""
6365
6366 #. type: Plain text
6367 #: build/C/man3/printf.3:68
6368 msgid "B<snprintf>(), B<vsnprintf>():"
6369 msgstr ""
6370
6371 #. type: Plain text
6372 #: build/C/man3/printf.3:71
6373 msgid ""
6374 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
6375 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
6376 msgstr ""
6377
6378 #. type: Plain text
6379 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:85
6380 msgid "or I<cc -std=c99>"
6381 msgstr ""
6382
6383 #. type: Plain text
6384 #: build/C/man3/printf.3:101
6385 msgid ""
6386 "The functions in the B<printf>()  family produce output according to a "
6387 "I<format> as described below.  The functions B<printf>()  and B<vprintf>()  "
6388 "write output to I<stdout>, the standard output stream; B<fprintf>()  and "
6389 "B<vfprintf>()  write output to the given output I<stream>; B<sprintf>(), "
6390 "B<snprintf>(), B<vsprintf>()  and B<vsnprintf>()  write to the character "
6391 "string I<str>."
6392 msgstr ""
6393
6394 #. type: Plain text
6395 #: build/C/man3/printf.3:110
6396 msgid ""
6397 "The functions B<snprintf>()  and B<vsnprintf>()  write at most I<size> bytes "
6398 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
6399 msgstr ""
6400
6401 #. type: Plain text
6402 #: build/C/man3/printf.3:134
6403 msgid ""
6404 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>()  "
6405 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
6406 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
6407 "instead of a variable number of arguments.  These functions do not call the "
6408 "I<va_end> macro.  Because they invoke the I<va_arg> macro, the value of "
6409 "I<ap> is undefined after the call.  See B<stdarg>(3)."
6410 msgstr ""
6411
6412 #. type: Plain text
6413 #: build/C/man3/printf.3:141
6414 msgid ""
6415 "These eight functions write the output under the control of a I<format> "
6416 "string that specifies how subsequent arguments (or arguments accessed via "
6417 "the variable-length argument facilities of B<stdarg>(3))  are converted for "
6418 "output."
6419 msgstr ""
6420
6421 #. type: Plain text
6422 #: build/C/man3/printf.3:152
6423 msgid ""
6424 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
6425 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>()  would cause "
6426 "copying to take place between objects that overlap (e.g., if the target "
6427 "string array and one of the supplied input arguments refer to the same "
6428 "buffer).  See NOTES."
6429 msgstr ""
6430
6431 #. type: SS
6432 #: build/C/man3/printf.3:152
6433 #, no-wrap
6434 msgid "Return value"
6435 msgstr ""
6436
6437 #. type: Plain text
6438 #: build/C/man3/printf.3:155
6439 msgid ""
6440 "Upon successful return, these functions return the number of characters "
6441 "printed (excluding the null byte used to end output to strings)."
6442 msgstr ""
6443
6444 #. type: Plain text
6445 #: build/C/man3/printf.3:171
6446 msgid ""
6447 "The functions B<snprintf>()  and B<vsnprintf>()  do not write more than "
6448 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)).  If "
6449 "the output was truncated due to this limit then the return value is the "
6450 "number of characters (excluding the terminating null byte)  which would have "
6451 "been written to the final string if enough space had been available.  Thus, "
6452 "a return value of I<size> or more means that the output was truncated.  (See "
6453 "also below under NOTES.)"
6454 msgstr ""
6455
6456 #. type: Plain text
6457 #: build/C/man3/printf.3:173
6458 msgid "If an output error is encountered, a negative value is returned."
6459 msgstr ""
6460
6461 #. type: SS
6462 #: build/C/man3/printf.3:173
6463 #, no-wrap
6464 msgid "Format of the format string"
6465 msgstr ""
6466
6467 #. type: Plain text
6468 #: build/C/man3/printf.3:195
6469 msgid ""
6470 "The format string is a character string, beginning and ending in its initial "
6471 "shift state, if any.  The format string is composed of zero or more "
6472 "directives: ordinary characters (not B<%>), which are copied unchanged to "
6473 "the output stream; and conversion specifications, each of which results in "
6474 "fetching zero or more subsequent arguments.  Each conversion specification "
6475 "is introduced by the character B<%>, and ends with a I<conversion "
6476 "specifier>.  In between there may be (in this order) zero or more I<flags>, "
6477 "an optional minimum I<field width>, an optional I<precision> and an optional "
6478 "I<length modifier>."
6479 msgstr ""
6480
6481 #. type: Plain text
6482 #: build/C/man3/printf.3:208
6483 msgid ""
6484 "The arguments must correspond properly (after type promotion) with the "
6485 "conversion specifier.  By default, the arguments are used in the order "
6486 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
6487 "next argument (and it is an error if insufficiently many arguments are "
6488 "given).  One can also specify explicitly which argument is taken, at each "
6489 "place where an argument is required, by writing \"%m$\" instead of "
6490 "\\(aq%\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
6491 "denotes the position in the argument list of the desired argument, indexed "
6492 "starting from 1.  Thus,"
6493 msgstr ""
6494
6495 #. type: Plain text
6496 #: build/C/man3/printf.3:212
6497 #, no-wrap
6498 msgid "printf(\"%*d\", width, num);\n"
6499 msgstr ""
6500
6501 #. type: Plain text
6502 #: build/C/man3/printf.3:216
6503 msgid "and"
6504 msgstr ""
6505
6506 #. type: Plain text
6507 #: build/C/man3/printf.3:220
6508 #, no-wrap
6509 msgid "printf(\"%2$*1$d\", width, num);\n"
6510 msgstr ""
6511
6512 #. type: Plain text
6513 #: build/C/man3/printf.3:236
6514 msgid ""
6515 "are equivalent.  The second style allows repeated references to the same "
6516 "argument.  The C99 standard does not include the style using \\(aq$\\(aq, "
6517 "which comes from the Single UNIX Specification.  If the style using "
6518 "\\(aq$\\(aq is used, it must be used throughout for all conversions taking "
6519 "an argument and all width and precision arguments, but it may be mixed with "
6520 "\"%%\" formats which do not consume an argument.  There may be no gaps in "
6521 "the numbers of arguments specified using \\(aq$\\(aq; for example, if "
6522 "arguments 1 and 3 are specified, argument 2 must also be specified somewhere "
6523 "in the format string."
6524 msgstr ""
6525
6526 #. type: Plain text
6527 #: build/C/man3/printf.3:246
6528 msgid ""
6529 "For some numeric conversions a radix character (\"decimal point\") or "
6530 "thousands' grouping character is used.  The actual character used depends on "
6531 "the B<LC_NUMERIC> part of the locale.  The POSIX locale uses \\(aq.\\(aq as "
6532 "radix character, and does not have a grouping character.  Thus,"
6533 msgstr ""
6534
6535 #. type: Plain text
6536 #: build/C/man3/printf.3:250
6537 #, no-wrap
6538 msgid "    printf(\"%\\(aq.2f\", 1234567.89);\n"
6539 msgstr ""
6540
6541 #. type: Plain text
6542 #: build/C/man3/printf.3:255
6543 msgid ""
6544 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
6545 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
6546 msgstr ""
6547
6548 #. type: SS
6549 #: build/C/man3/printf.3:255
6550 #, no-wrap
6551 msgid "The flag characters"
6552 msgstr ""
6553
6554 #. type: Plain text
6555 #: build/C/man3/printf.3:257
6556 msgid "The character % is followed by zero or more of the following flags:"
6557 msgstr ""
6558
6559 #. type: TP
6560 #: build/C/man3/printf.3:257
6561 #, no-wrap
6562 msgid "B<#>"
6563 msgstr ""
6564
6565 #. type: Plain text
6566 #: build/C/man3/printf.3:291
6567 msgid ""
6568 "The value should be converted to an \"alternate form\".  For B<o> "
6569 "conversions, the first character of the output string is made zero (by "
6570 "prefixing a 0 if it was not zero already).  For B<x> and B<X> conversions, a "
6571 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
6572 "prepended to it.  For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
6573 "conversions, the result will always contain a decimal point, even if no "
6574 "digits follow it (normally, a decimal point appears in the results of those "
6575 "conversions only if a digit follows).  For B<g> and B<G> conversions, "
6576 "trailing zeros are not removed from the result as they would otherwise be.  "
6577 "For other conversions, the result is undefined."
6578 msgstr ""
6579
6580 #. type: TP
6581 #: build/C/man3/printf.3:291
6582 #, no-wrap
6583 msgid "B<\\&0>"
6584 msgstr ""
6585
6586 #. type: Plain text
6587 #: build/C/man3/printf.3:331
6588 msgid ""
6589 "The value should be zero padded.  For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
6590 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
6591 "converted value is padded on the left with zeros rather than blanks.  If the "
6592 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored.  If a "
6593 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
6594 "and B<X>), the B<\\&0> flag is ignored.  For other conversions, the behavior "
6595 "is undefined."
6596 msgstr ""
6597
6598 #. type: TP
6599 #: build/C/man3/printf.3:331
6600 #, no-wrap
6601 msgid "B<->"
6602 msgstr ""
6603
6604 #. type: Plain text
6605 #: build/C/man3/printf.3:344
6606 msgid ""
6607 "The converted value is to be left adjusted on the field boundary.  (The "
6608 "default is right justification.)  Except for B<n> conversions, the converted "
6609 "value is padded on the right with blanks, rather than on the left with "
6610 "blanks or zeros.  A B<-> overrides a B<\\&0> if both are given."
6611 msgstr ""
6612
6613 #. type: TP
6614 #: build/C/man3/printf.3:344
6615 #, no-wrap
6616 msgid "B<\\(aq \\(aq>"
6617 msgstr ""
6618
6619 #. type: Plain text
6620 #: build/C/man3/printf.3:348
6621 msgid ""
6622 "(a space) A blank should be left before a positive number (or empty string) "
6623 "produced by a signed conversion."
6624 msgstr ""
6625
6626 #. type: TP
6627 #: build/C/man3/printf.3:348
6628 #, no-wrap
6629 msgid "B<+>"
6630 msgstr ""
6631
6632 #. type: Plain text
6633 #: build/C/man3/printf.3:356
6634 msgid ""
6635 "A sign (+ or -) should always be placed before a number produced by a signed "
6636 "conversion.  By default a sign is used only for negative numbers.  A B<+> "
6637 "overrides a space if both are used."
6638 msgstr ""
6639
6640 #. type: Plain text
6641 #: build/C/man3/printf.3:359
6642 msgid ""
6643 "The five flag characters above are defined in the C standard.  The SUSv2 "
6644 "specifies one further flag character."
6645 msgstr ""
6646
6647 #. type: TP
6648 #: build/C/man3/printf.3:359
6649 #, no-wrap
6650 msgid "B<\\(aq>"
6651 msgstr ""
6652
6653 #. type: Plain text
6654 #: build/C/man3/printf.3:376
6655 msgid ""
6656 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>)  the "
6657 "output is to be grouped with thousands' grouping characters if the locale "
6658 "information indicates any.  Note that many versions of B<gcc>(1)  cannot "
6659 "parse this option and will issue a warning.  SUSv2 does not include "
6660 "I<%\\(aqF>."
6661 msgstr ""
6662
6663 #. type: Plain text
6664 #: build/C/man3/printf.3:378
6665 msgid "glibc 2.2 adds one further flag character."
6666 msgstr ""
6667
6668 #. type: TP
6669 #: build/C/man3/printf.3:378
6670 #, no-wrap
6671 msgid "B<I>"
6672 msgstr ""
6673
6674 #.  outdigits keyword in locale file
6675 #. type: Plain text
6676 #: build/C/man3/printf.3:388
6677 msgid ""
6678 "For decimal integer conversion (B<i>, B<d>, B<u>)  the output uses the "
6679 "locale's alternative output digits, if any.  For example, since glibc 2.2.3 "
6680 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
6681 msgstr ""
6682
6683 #. type: SS
6684 #: build/C/man3/printf.3:388
6685 #, no-wrap
6686 msgid "The field width"
6687 msgstr ""
6688
6689 #. type: Plain text
6690 #: build/C/man3/printf.3:404
6691 msgid ""
6692 "An optional decimal digit string (with nonzero first digit) specifying a "
6693 "minimum field width.  If the converted value has fewer characters than the "
6694 "field width, it will be padded with spaces on the left (or right, if the "
6695 "left-adjustment flag has been given).  Instead of a decimal digit string one "
6696 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
6697 "the field width is given in the next argument, or in the I<m>-th argument, "
6698 "respectively, which must be of type I<int>.  A negative field width is taken "
6699 "as a \\(aq-\\(aq flag followed by a positive field width.  In no case does a "
6700 "nonexistent or small field width cause truncation of a field; if the result "
6701 "of a conversion is wider than the field width, the field is expanded to "
6702 "contain the conversion result."
6703 msgstr ""
6704
6705 #. type: SS
6706 #: build/C/man3/printf.3:404
6707 #, no-wrap
6708 msgid "The precision"
6709 msgstr ""
6710
6711 #. type: Plain text
6712 #: build/C/man3/printf.3:440
6713 msgid ""
6714 "An optional precision, in the form of a period (\\(aq.\\(aq)  followed by an "
6715 "optional decimal digit string.  Instead of a decimal digit string one may "
6716 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
6717 "precision is given in the next argument, or in the m-th argument, "
6718 "respectively, which must be of type I<int>.  If the precision is given as "
6719 "just \\(aq.\\(aq, or the precision is negative, the precision is taken to be "
6720 "zero.  This gives the minimum number of digits to appear for B<d>, B<i>, "
6721 "B<o>, B<u>, B<x>, and B<X> conversions, the number of digits to appear after "
6722 "the radix character for B<a>, B<A>, B<e>, B<E>, B<f>, and B<F> conversions, "
6723 "the maximum number of significant digits for B<g> and B<G> conversions, or "
6724 "the maximum number of characters to be printed from a string for B<s> and "
6725 "B<S> conversions."
6726 msgstr ""
6727
6728 #. type: SS
6729 #: build/C/man3/printf.3:440
6730 #, no-wrap
6731 msgid "The length modifier"
6732 msgstr ""
6733
6734 #. type: Plain text
6735 #: build/C/man3/printf.3:450
6736 msgid ""
6737 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
6738 "B<X> conversion."
6739 msgstr ""
6740
6741 #. type: TP
6742 #: build/C/man3/printf.3:450 build/C/man3/scanf.3:294
6743 #, no-wrap
6744 msgid "B<hh>"
6745 msgstr ""
6746
6747 #. type: Plain text
6748 #: build/C/man3/printf.3:461
6749 msgid ""
6750 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
6751 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
6752 "I<signed char> argument."
6753 msgstr ""
6754
6755 #. type: TP
6756 #: build/C/man3/printf.3:461 build/C/man3/scanf.3:284
6757 #, no-wrap
6758 msgid "B<h>"
6759 msgstr ""
6760
6761 #. type: Plain text
6762 #: build/C/man3/printf.3:472
6763 msgid ""
6764 "A following integer conversion corresponds to a I<short int> or I<unsigned "
6765 "short int> argument, or a following B<n> conversion corresponds to a pointer "
6766 "to a I<short int> argument."
6767 msgstr ""
6768
6769 #. type: TP
6770 #: build/C/man3/printf.3:472 build/C/man3/scanf.3:311
6771 #, no-wrap
6772 msgid "B<l>"
6773 msgstr ""
6774
6775 #. type: Plain text
6776 #: build/C/man3/printf.3:491
6777 msgid ""
6778 "(ell) A following integer conversion corresponds to a I<long int> or "
6779 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
6780 "a pointer to a I<long int> argument, or a following B<c> conversion "
6781 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
6782 "corresponds to a pointer to I<wchar_t> argument."
6783 msgstr ""
6784
6785 #. type: TP
6786 #: build/C/man3/printf.3:491
6787 #, no-wrap
6788 msgid "B<ll>"
6789 msgstr ""
6790
6791 #. type: Plain text
6792 #: build/C/man3/printf.3:503
6793 msgid ""
6794 "(ell-ell).  A following integer conversion corresponds to a I<long long int> "
6795 "or I<unsigned long long int> argument, or a following B<n> conversion "
6796 "corresponds to a pointer to a I<long long int> argument."
6797 msgstr ""
6798
6799 #. type: TP
6800 #: build/C/man3/printf.3:503 build/C/man3/scanf.3:338
6801 #, no-wrap
6802 msgid "B<L>"
6803 msgstr ""
6804
6805 #. type: Plain text
6806 #: build/C/man3/printf.3:519
6807 msgid ""
6808 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
6809 "corresponds to a I<long double> argument.  (C99 allows %LF, but SUSv2 does "
6810 "not.)"
6811 msgstr ""
6812
6813 #. type: TP
6814 #: build/C/man3/printf.3:519 build/C/man3/scanf.3:354
6815 #, no-wrap
6816 msgid "B<q>"
6817 msgstr ""
6818
6819 #. type: Plain text
6820 #: build/C/man3/printf.3:525
6821 msgid ""
6822 "(\"quad\". 4.4BSD and Linux libc5 only.  Don't use.)  This is a synonym for "
6823 "B<ll>."
6824 msgstr ""
6825
6826 #. type: TP
6827 #: build/C/man3/printf.3:525 build/C/man3/scanf.3:302
6828 #, no-wrap
6829 msgid "B<j>"
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man3/printf.3:532
6834 msgid ""
6835 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
6836 "argument."
6837 msgstr ""
6838
6839 #. type: TP
6840 #: build/C/man3/printf.3:532 build/C/man3/scanf.3:366
6841 #, no-wrap
6842 msgid "B<z>"
6843 msgstr ""
6844
6845 #. type: Plain text
6846 #: build/C/man3/printf.3:543
6847 msgid ""
6848 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
6849 "argument.  (Linux libc5 has B<Z> with this meaning.  Don't use it.)"
6850 msgstr ""
6851
6852 #. type: TP
6853 #: build/C/man3/printf.3:543 build/C/man3/scanf.3:359
6854 #, no-wrap
6855 msgid "B<t>"
6856 msgstr ""
6857
6858 #. type: Plain text
6859 #: build/C/man3/printf.3:548
6860 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
6861 msgstr ""
6862
6863 #. type: Plain text
6864 #: build/C/man3/printf.3:577
6865 msgid ""
6866 "The SUSv2 knows about only the length modifiers B<h> (in B<hd>, B<hi>, "
6867 "B<ho>, B<hx>, B<hX>, B<hn>)  and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
6868 "B<ln>, B<lc>, B<ls>)  and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
6869 msgstr ""
6870
6871 #. type: SS
6872 #: build/C/man3/printf.3:577
6873 #, no-wrap
6874 msgid "The conversion specifier"
6875 msgstr ""
6876
6877 #. type: Plain text
6878 #: build/C/man3/printf.3:580
6879 msgid ""
6880 "A character that specifies the type of conversion to be applied.  The "
6881 "conversion specifiers and their meanings are:"
6882 msgstr ""
6883
6884 #. type: TP
6885 #: build/C/man3/printf.3:580
6886 #, no-wrap
6887 msgid "B<d>, B<i>"
6888 msgstr ""
6889
6890 #. type: Plain text
6891 #: build/C/man3/printf.3:590
6892 msgid ""
6893 "The I<int> argument is converted to signed decimal notation.  The precision, "
6894 "if any, gives the minimum number of digits that must appear; if the "
6895 "converted value requires fewer digits, it is padded on the left with zeros.  "
6896 "The default precision is 1.  When 0 is printed with an explicit precision 0, "
6897 "the output is empty."
6898 msgstr ""
6899
6900 #. type: TP
6901 #: build/C/man3/printf.3:590
6902 #, no-wrap
6903 msgid "B<o>, B<u>, B<x>, B<X>"
6904 msgstr ""
6905
6906 #. type: Plain text
6907 #: build/C/man3/printf.3:617
6908 msgid ""
6909 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
6910 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>)  notation.  The "
6911 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
6912 "used for B<X> conversions.  The precision, if any, gives the minimum number "
6913 "of digits that must appear; if the converted value requires fewer digits, it "
6914 "is padded on the left with zeros.  The default precision is 1.  When 0 is "
6915 "printed with an explicit precision 0, the output is empty."
6916 msgstr ""
6917
6918 #. type: TP
6919 #: build/C/man3/printf.3:617
6920 #, no-wrap
6921 msgid "B<e>, B<E>"
6922 msgstr ""
6923
6924 #. type: Plain text
6925 #: build/C/man3/printf.3:636
6926 msgid ""
6927 "The I<double> argument is rounded and converted in the style "
6928 "[-]dB<\\&.>dddB<e>\\(+-dd where there is one digit before the decimal-point "
6929 "character and the number of digits after it is equal to the precision; if "
6930 "the precision is missing, it is taken as 6; if the precision is zero, no "
6931 "decimal-point character appears.  An B<E> conversion uses the letter B<E> "
6932 "(rather than B<e>)  to introduce the exponent.  The exponent always contains "
6933 "at least two digits; if the value is zero, the exponent is 00."
6934 msgstr ""
6935
6936 #. type: TP
6937 #: build/C/man3/printf.3:636
6938 #, no-wrap
6939 msgid "B<f>, B<F>"
6940 msgstr ""
6941
6942 #. type: Plain text
6943 #: build/C/man3/printf.3:647
6944 msgid ""
6945 "The I<double> argument is rounded and converted to decimal notation in the "
6946 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
6947 "character is equal to the precision specification.  If the precision is "
6948 "missing, it is taken as 6; if the precision is explicitly zero, no "
6949 "decimal-point character appears.  If a decimal point appears, at least one "
6950 "digit appears before it."
6951 msgstr ""
6952
6953 #. type: Plain text
6954 #: build/C/man3/printf.3:658
6955 msgid ""
6956 "(The SUSv2 does not know about B<F> and says that character string "
6957 "representations for infinity and NaN may be made available.  The C99 "
6958 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
6959 "starting with \"nan\" for NaN, in the case of B<f> conversion, and "
6960 "\"[-]INF\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
6961 msgstr ""
6962
6963 #. type: TP
6964 #: build/C/man3/printf.3:658
6965 #, no-wrap
6966 msgid "B<g>, B<G>"
6967 msgstr ""
6968
6969 #. type: Plain text
6970 #: build/C/man3/printf.3:683
6971 msgid ""
6972 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
6973 "for B<G> conversions).  The precision specifies the number of significant "
6974 "digits.  If the precision is missing, 6 digits are given; if the precision "
6975 "is zero, it is treated as 1.  Style B<e> is used if the exponent from its "
6976 "conversion is less than -4 or greater than or equal to the precision.  "
6977 "Trailing zeros are removed from the fractional part of the result; a decimal "
6978 "point appears only if it is followed by at least one digit."
6979 msgstr ""
6980
6981 #. type: TP
6982 #: build/C/man3/printf.3:683
6983 #, no-wrap
6984 msgid "B<a>, B<A>"
6985 msgstr ""
6986
6987 #. type: Plain text
6988 #: build/C/man3/printf.3:707
6989 msgid ""
6990 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
6991 "to hexadecimal notation (using the letters abcdef)  in the style "
6992 "[-]B<0x>hB<\\&.>hhhhB<p>\\(+-; for B<A> conversion the prefix B<0X>, the "
6993 "letters ABCDEF, and the exponent separator B<P> is used.  There is one "
6994 "hexadecimal digit before the decimal point, and the number of digits after "
6995 "it is equal to the precision.  The default precision suffices for an exact "
6996 "representation of the value if an exact representation in base 2 exists and "
6997 "otherwise is sufficiently large to distinguish values of type I<double>.  "
6998 "The digit before the decimal point is unspecified for nonnormalized numbers, "
6999 "and nonzero but otherwise unspecified for normalized numbers."
7000 msgstr ""
7001
7002 #. type: TP
7003 #: build/C/man3/printf.3:707 build/C/man3/scanf.3:459 build/C/man3/wprintf.3:151
7004 #, no-wrap
7005 msgid "B<c>"
7006 msgstr ""
7007
7008 #. type: Plain text
7009 #: build/C/man3/printf.3:725
7010 msgid ""
7011 "If no B<l> modifier is present, the I<int> argument is converted to an "
7012 "I<unsigned char>, and the resulting character is written.  If an B<l> "
7013 "modifier is present, the I<wint_t> (wide character) argument is converted to "
7014 "a multibyte sequence by a call to the B<wcrtomb>(3)  function, with a "
7015 "conversion state starting in the initial state, and the resulting multibyte "
7016 "string is written."
7017 msgstr ""
7018
7019 #. type: TP
7020 #: build/C/man3/printf.3:725 build/C/man3/scanf.3:451 build/C/man3/wprintf.3:165
7021 #, no-wrap
7022 msgid "B<s>"
7023 msgstr ""
7024
7025 #. type: Plain text
7026 #: build/C/man3/printf.3:740
7027 msgid ""
7028 "If no B<l> modifier is present: The I<const char\\ *> argument is expected "
7029 "to be a pointer to an array of character type (pointer to a string).  "
7030 "Characters from the array are written up to (but not including) a "
7031 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
7032 "than the number specified are written.  If a precision is given, no null "
7033 "byte need be present; if the precision is not specified, or is greater than "
7034 "the size of the array, the array must contain a terminating null byte."
7035 msgstr ""
7036
7037 #. type: Plain text
7038 #: build/C/man3/printf.3:767
7039 msgid ""
7040 "If an B<l> modifier is present: The I<const wchar_t\\ *> argument is "
7041 "expected to be a pointer to an array of wide characters.  Wide characters "
7042 "from the array are converted to multibyte characters (each by a call to the "
7043 "B<wcrtomb>(3)  function, with a conversion state starting in the initial "
7044 "state before the first wide character), up to and including a terminating "
7045 "null wide character.  The resulting multibyte characters are written up to "
7046 "(but not including) the terminating null byte.  If a precision is specified, "
7047 "no more bytes than the number specified are written, but no partial "
7048 "multibyte characters are written.  Note that the precision determines the "
7049 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
7050 "positions>.  The array must contain a terminating null wide character, "
7051 "unless a precision is given and it is so small that the number of bytes "
7052 "written exceeds it before the end of the array is reached."
7053 msgstr ""
7054
7055 #. type: TP
7056 #: build/C/man3/printf.3:767
7057 #, no-wrap
7058 msgid "B<C>"
7059 msgstr ""
7060
7061 #. type: Plain text
7062 #: build/C/man3/printf.3:773
7063 msgid "(Not in C99, but in SUSv2.)  Synonym for B<lc>.  Don't use."
7064 msgstr ""
7065
7066 #. type: TP
7067 #: build/C/man3/printf.3:773
7068 #, no-wrap
7069 msgid "B<S>"
7070 msgstr ""
7071
7072 #. type: Plain text
7073 #: build/C/man3/printf.3:779
7074 msgid "(Not in C99, but in SUSv2.)  Synonym for B<ls>.  Don't use."
7075 msgstr ""
7076
7077 #. type: TP
7078 #: build/C/man3/printf.3:779 build/C/man3/scanf.3:502
7079 #, no-wrap
7080 msgid "B<p>"
7081 msgstr ""
7082
7083 #. type: Plain text
7084 #: build/C/man3/printf.3:787
7085 msgid ""
7086 "The I<void\\ *> pointer argument is printed in hexadecimal (as if by B<%#x> "
7087 "or B<%#lx>)."
7088 msgstr ""
7089
7090 #. type: TP
7091 #: build/C/man3/printf.3:787 build/C/man3/scanf.3:510
7092 #, no-wrap
7093 msgid "B<n>"
7094 msgstr ""
7095
7096 #. type: Plain text
7097 #: build/C/man3/printf.3:794
7098 msgid ""
7099 "The number of characters written so far is stored into the integer indicated "
7100 "by the I<int\\ *> (or variant) pointer argument.  No argument is converted."
7101 msgstr ""
7102
7103 #. type: TP
7104 #: build/C/man3/printf.3:794
7105 #, no-wrap
7106 msgid "B<m>"
7107 msgstr ""
7108
7109 #. type: Plain text
7110 #: build/C/man3/printf.3:800
7111 msgid ""
7112 "(Glibc extension.)  Print output of I<strerror(errno)>.  No argument is "
7113 "required."
7114 msgstr ""
7115
7116 #. type: TP
7117 #: build/C/man3/printf.3:800 build/C/man3/scanf.3:377
7118 #, no-wrap
7119 msgid "B<%>"
7120 msgstr ""
7121
7122 #. type: Plain text
7123 #: build/C/man3/printf.3:806
7124 msgid ""
7125 "A \\(aq%\\(aq is written.  No argument is converted.  The complete "
7126 "conversion specification is \\(aq%%\\(aq."
7127 msgstr ""
7128
7129 #. type: Plain text
7130 #: build/C/man3/printf.3:821
7131 msgid ""
7132 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
7133 "and B<vsprintf>()  functions conform to C89 and C99.  The B<snprintf>()  and "
7134 "B<vsnprintf>()  functions conform to C99."
7135 msgstr ""
7136
7137 #. type: Plain text
7138 #: build/C/man3/printf.3:834
7139 msgid ""
7140 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
7141 "other: when B<snprintf>()  is called with I<size>=0 then SUSv2 stipulates an "
7142 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
7143 "this case, and gives the return value (as always)  as the number of "
7144 "characters that would have been written in case the output string has been "
7145 "large enough."
7146 msgstr ""
7147
7148 #. type: Plain text
7149 #: build/C/man3/printf.3:848
7150 msgid ""
7151 "Linux libc4 knows about the five C standard flags.  It knows about the "
7152 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
7153 "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 "
7154 "B<X>, where B<F> is a synonym for B<f>.  Additionally, it accepts B<D>, "
7155 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>.  (This is bad, and "
7156 "caused serious bugs later, when support for B<%D> disappeared.)  No "
7157 "locale-dependent radix character, no thousands' separator, no NaN or "
7158 "infinity, no \"%m$\" and \"*m$\"."
7159 msgstr ""
7160
7161 #. type: Plain text
7162 #: build/C/man3/printf.3:859
7163 msgid ""
7164 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
7165 "locale, \"%m$\" and \"*m$\".  It knows about the length modifiers B<h>, "
7166 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
7167 "double> and for I<long long int> (this is a bug).  It no longer recognizes "
7168 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
7169 "outputs I<strerror(errno)>."
7170 msgstr ""
7171
7172 #. type: Plain text
7173 #: build/C/man3/printf.3:861
7174 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
7175 msgstr ""
7176
7177 #. type: Plain text
7178 #: build/C/man3/printf.3:864
7179 msgid ""
7180 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
7181 "characters B<a> and B<A>."
7182 msgstr ""
7183
7184 #. type: Plain text
7185 #: build/C/man3/printf.3:867
7186 msgid ""
7187 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
7188 "flag character B<I>."
7189 msgstr ""
7190
7191 #. type: Plain text
7192 #: build/C/man3/printf.3:869
7193 msgid "Some programs imprudently rely on code such as the following"
7194 msgstr ""
7195
7196 #. type: Plain text
7197 #: build/C/man3/printf.3:871
7198 #, no-wrap
7199 msgid "    sprintf(buf, \"%s some further text\", buf);\n"
7200 msgstr ""
7201
7202 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7075
7203 #. type: Plain text
7204 #: build/C/man3/printf.3:887
7205 msgid ""
7206 "to append text to I<buf>.  However, the standards explicitly note that the "
7207 "results are undefined if source and destination buffers overlap when calling "
7208 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>().  Depending "
7209 "on the version of B<gcc>(1)  used, and the compiler options employed, calls "
7210 "such as the above will B<not> produce the expected results."
7211 msgstr ""
7212
7213 #.  .SH HISTORY
7214 #.  UNIX V7 defines the three routines
7215 #.  .BR printf (),
7216 #.  .BR fprintf (),
7217 #.  .BR sprintf (),
7218 #.  and has the flag \-, the width or precision *, the length modifier l,
7219 #.  and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
7220 #.  This is still true for 2.9.1BSD, but 2.10BSD has the flags
7221 #.  #, + and <space> and no longer mentions D,O,U,X.
7222 #.  2.11BSD has
7223 #.  .BR vprintf (),
7224 #.  .BR vfprintf (),
7225 #.  .BR vsprintf (),
7226 #.  and warns not to use D,O,U,X.
7227 #.  4.3BSD Reno has the flag 0, the length modifiers h and L,
7228 #.  and the conversions n, p, E, G, X (with current meaning)
7229 #.  and deprecates D,O,U.
7230 #.  4.4BSD introduces the functions
7231 #.  .BR snprintf ()
7232 #.  and
7233 #.  .BR vsnprintf (),
7234 #.  and the length modifier q.
7235 #.  FreeBSD also has functions
7236 #.  .BR asprintf ()
7237 #.  and
7238 #.  .BR vasprintf (),
7239 #.  that allocate a buffer large enough for
7240 #.  .BR sprintf ().
7241 #.  In glibc there are functions
7242 #.  .BR dprintf ()
7243 #.  and
7244 #.  .BR vdprintf ()
7245 #.  that print to a file descriptor instead of a stream.
7246 #. type: Plain text
7247 #: build/C/man3/printf.3:929
7248 msgid ""
7249 "The glibc implementation of the functions B<snprintf>()  and B<vsnprintf>()  "
7250 "conforms to the C99 standard, that is, behaves as described above, since "
7251 "glibc version 2.1.  Until glibc 2.0.6 they would return -1 when the output "
7252 "was truncated."
7253 msgstr ""
7254
7255 #. type: Plain text
7256 #: build/C/man3/printf.3:946
7257 msgid ""
7258 "Because B<sprintf>()  and B<vsprintf>()  assume an arbitrarily long string, "
7259 "callers must be careful not to overflow the actual space; this is often "
7260 "impossible to assure.  Note that the length of the strings produced is "
7261 "locale-dependent and difficult to predict.  Use B<snprintf>()  and "
7262 "B<vsnprintf>()  instead (or B<asprintf>(3)  and B<vasprintf>(3))."
7263 msgstr ""
7264
7265 #. type: Plain text
7266 #: build/C/man3/printf.3:959
7267 msgid ""
7268 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
7269 "contains an B<snprintf>()  equivalent to B<sprintf>(), that is, one that "
7270 "ignores the I<size> argument.  Thus, the use of B<snprintf>()  with early "
7271 "libc4 leads to serious security problems."
7272 msgstr ""
7273
7274 #.  .PP
7275 #.  Some floating-point conversions under early libc4
7276 #.  caused memory leaks.
7277 #. type: Plain text
7278 #: build/C/man3/printf.3:973
7279 msgid ""
7280 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
7281 "contain a % character.  If I<foo> comes from untrusted user input, it may "
7282 "contain B<%n>, causing the B<printf>()  call to write to memory and creating "
7283 "a security hole."
7284 msgstr ""
7285
7286 #. type: Plain text
7287 #: build/C/man3/printf.3:977
7288 msgid "To print I<Pi> to five decimal places:"
7289 msgstr ""
7290
7291 #. type: Plain text
7292 #: build/C/man3/printf.3:983
7293 #, no-wrap
7294 msgid ""
7295 "#include E<lt>math.hE<gt>\n"
7296 "#include E<lt>stdio.hE<gt>\n"
7297 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
7298 msgstr ""
7299
7300 #. type: Plain text
7301 #: build/C/man3/printf.3:992
7302 msgid ""
7303 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
7304 "I<weekday> and I<month> are pointers to strings:"
7305 msgstr ""
7306
7307 #. type: Plain text
7308 #: build/C/man3/printf.3:998
7309 #, no-wrap
7310 msgid ""
7311 "#include E<lt>stdio.hE<gt>\n"
7312 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
7313 "        weekday, month, day, hour, min);\n"
7314 msgstr ""
7315
7316 #. type: Plain text
7317 #: build/C/man3/printf.3:1004
7318 msgid ""
7319 "Many countries use the day-month-year order.  Hence, an internationalized "
7320 "version must be able to print the arguments in an order specified by the "
7321 "format:"
7322 msgstr ""
7323
7324 #. type: Plain text
7325 #: build/C/man3/printf.3:1010
7326 #, no-wrap
7327 msgid ""
7328 "#include E<lt>stdio.hE<gt>\n"
7329 "fprintf(stdout, format,\n"
7330 "        weekday, month, day, hour, min);\n"
7331 msgstr ""
7332
7333 #. type: Plain text
7334 #: build/C/man3/printf.3:1017
7335 msgid ""
7336 "where I<format> depends on locale, and may permute the arguments.  With the "
7337 "value:"
7338 msgstr ""
7339
7340 #. type: Plain text
7341 #: build/C/man3/printf.3:1021
7342 #, no-wrap
7343 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
7344 msgstr ""
7345
7346 #. type: Plain text
7347 #: build/C/man3/printf.3:1025
7348 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
7349 msgstr ""
7350
7351 #. type: Plain text
7352 #: build/C/man3/printf.3:1028
7353 msgid ""
7354 "To allocate a sufficiently large string and print into it (code correct for "
7355 "both glibc 2.0 and glibc 2.1):"
7356 msgstr ""
7357
7358 #. type: Plain text
7359 #: build/C/man3/printf.3:1031
7360 msgid ""
7361 "If truncation occurs in glibc versions prior to 2.0.6, this is treated as an "
7362 "error instead of being handled gracefully."
7363 msgstr ""
7364
7365 #. type: Plain text
7366 #: build/C/man3/printf.3:1036
7367 #, no-wrap
7368 msgid ""
7369 "#include E<lt>stdio.hE<gt>\n"
7370 "#include E<lt>stdlib.hE<gt>\n"
7371 "#include E<lt>stdarg.hE<gt>\n"
7372 msgstr ""
7373
7374 #. type: Plain text
7375 #: build/C/man3/printf.3:1044
7376 #, no-wrap
7377 msgid ""
7378 "char *\n"
7379 "make_message(const char *fmt, ...)\n"
7380 "{\n"
7381 "    int n;\n"
7382 "    int size = 100;     /* Guess we need no more than 100 bytes */\n"
7383 "    char *p, *np;\n"
7384 "    va_list ap;\n"
7385 msgstr ""
7386
7387 #. type: Plain text
7388 #: build/C/man3/printf.3:1047
7389 #, no-wrap
7390 msgid ""
7391 "    if ((p = malloc(size)) == NULL)\n"
7392 "        return NULL;\n"
7393 msgstr ""
7394
7395 #. type: Plain text
7396 #: build/C/man3/printf.3:1049
7397 #, no-wrap
7398 msgid "    while (1) {\n"
7399 msgstr ""
7400
7401 #. type: Plain text
7402 #: build/C/man3/printf.3:1051
7403 #, no-wrap
7404 msgid "        /* Try to print in the allocated space */\n"
7405 msgstr ""
7406
7407 #. type: Plain text
7408 #: build/C/man3/printf.3:1055
7409 #, no-wrap
7410 msgid ""
7411 "        va_start(ap, fmt);\n"
7412 "        n = vsnprintf(p, size, fmt, ap);\n"
7413 "        va_end(ap);\n"
7414 msgstr ""
7415
7416 #. type: Plain text
7417 #: build/C/man3/printf.3:1057
7418 #, no-wrap
7419 msgid "        /* Check error code */\n"
7420 msgstr ""
7421
7422 #. type: Plain text
7423 #: build/C/man3/printf.3:1060
7424 #, no-wrap
7425 msgid ""
7426 "        if (n E<lt> 0)\n"
7427 "            return NULL;\n"
7428 msgstr ""
7429
7430 #. type: Plain text
7431 #: build/C/man3/printf.3:1062
7432 #, no-wrap
7433 msgid "        /* If that worked, return the string */\n"
7434 msgstr ""
7435
7436 #. type: Plain text
7437 #: build/C/man3/printf.3:1065
7438 #, no-wrap
7439 msgid ""
7440 "        if (n E<lt> size)\n"
7441 "            return p;\n"
7442 msgstr ""
7443
7444 #. type: Plain text
7445 #: build/C/man3/printf.3:1067
7446 #, no-wrap
7447 msgid "        /* Else try again with more space */\n"
7448 msgstr ""
7449
7450 #. type: Plain text
7451 #: build/C/man3/printf.3:1069
7452 #, no-wrap
7453 msgid "        size = n + 1;       /* Precisely what is needed */\n"
7454 msgstr ""
7455
7456 #. type: Plain text
7457 #: build/C/man3/printf.3:1079
7458 #, no-wrap
7459 msgid ""
7460 "        if ((np = realloc (p, size)) == NULL) {\n"
7461 "            free(p);\n"
7462 "            return NULL;\n"
7463 "        } else {\n"
7464 "            p = np;\n"
7465 "        }\n"
7466 "    }\n"
7467 "}\n"
7468 msgstr ""
7469
7470 #. type: Plain text
7471 #: build/C/man3/printf.3:1089
7472 msgid ""
7473 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
7474 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
7475 msgstr ""
7476
7477 #. type: TH
7478 #: build/C/man3/puts.3:26
7479 #, no-wrap
7480 msgid "PUTS"
7481 msgstr ""
7482
7483 #. type: TH
7484 #: build/C/man3/puts.3:26
7485 #, no-wrap
7486 msgid "2011-09-28"
7487 msgstr ""
7488
7489 #. type: Plain text
7490 #: build/C/man3/puts.3:29
7491 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
7492 msgstr ""
7493
7494 #. type: Plain text
7495 #: build/C/man3/puts.3:34
7496 #, no-wrap
7497 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7498 msgstr ""
7499
7500 #. type: Plain text
7501 #: build/C/man3/puts.3:36
7502 #, no-wrap
7503 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
7504 msgstr ""
7505
7506 #. type: Plain text
7507 #: build/C/man3/puts.3:38
7508 #, no-wrap
7509 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7510 msgstr ""
7511
7512 #. type: Plain text
7513 #: build/C/man3/puts.3:40
7514 #, no-wrap
7515 msgid "B<int putchar(int >I<c>B<);>\n"
7516 msgstr ""
7517
7518 #. type: Plain text
7519 #: build/C/man3/puts.3:42
7520 #, no-wrap
7521 msgid "B<int puts(const char *>I<s>B<);>\n"
7522 msgstr ""
7523
7524 #. type: Plain text
7525 #: build/C/man3/puts.3:51
7526 msgid ""
7527 "B<fputc>()  writes the character I<c>, cast to an I<unsigned char>, to "
7528 "I<stream>."
7529 msgstr ""
7530
7531 #. type: Plain text
7532 #: build/C/man3/puts.3:58
7533 msgid ""
7534 "B<fputs>()  writes the string I<s> to I<stream>, without its terminating "
7535 "null byte (\\(aq\\e0\\(aq)."
7536 msgstr ""
7537
7538 #. type: Plain text
7539 #: build/C/man3/puts.3:65
7540 msgid ""
7541 "B<putc>()  is equivalent to B<fputc>()  except that it may be implemented as "
7542 "a macro which evaluates I<stream> more than once."
7543 msgstr ""
7544
7545 #. type: Plain text
7546 #: build/C/man3/puts.3:69
7547 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<,>I<stdout>B<).>"
7548 msgstr ""
7549
7550 #. type: Plain text
7551 #: build/C/man3/puts.3:76
7552 msgid "B<puts>()  writes the string I<s> and a trailing newline to I<stdout>."
7553 msgstr ""
7554
7555 #. type: Plain text
7556 #: build/C/man3/puts.3:81
7557 msgid ""
7558 "Calls to the functions described here can be mixed with each other and with "
7559 "calls to other output functions from the I<stdio> library for the same "
7560 "output stream."
7561 msgstr ""
7562
7563 #. type: Plain text
7564 #: build/C/man3/puts.3:96
7565 msgid ""
7566 "B<fputc>(), B<putc>()  and B<putchar>()  return the character written as an "
7567 "I<unsigned char> cast to an I<int> or B<EOF> on error."
7568 msgstr ""
7569
7570 #. type: Plain text
7571 #: build/C/man3/puts.3:103
7572 msgid ""
7573 "B<puts>()  and B<fputs>()  return a nonnegative number on success, or B<EOF> "
7574 "on error."
7575 msgstr ""
7576
7577 #. type: Plain text
7578 #: build/C/man3/puts.3:112
7579 msgid ""
7580 "It is not advisable to mix calls to output functions from the I<stdio> "
7581 "library with low-level calls to B<write>(2)  for the file descriptor "
7582 "associated with the same output stream; the results will be undefined and "
7583 "very probably not what you want."
7584 msgstr ""
7585
7586 #. type: Plain text
7587 #: build/C/man3/puts.3:124
7588 msgid ""
7589 "B<write>(2), B<ferror>(3), B<fopen>(3), B<fputwc>(3), B<fputws>(3), "
7590 "B<fseek>(3), B<fwrite>(3), B<gets>(3), B<putwchar>(3), B<scanf>(3), "
7591 "B<unlocked_stdio>(3)"
7592 msgstr ""
7593
7594 #. type: TH
7595 #: build/C/man2/read.2:35
7596 #, no-wrap
7597 msgid "READ"
7598 msgstr ""
7599
7600 #. type: TH
7601 #: build/C/man2/read.2:35
7602 #, no-wrap
7603 msgid "2013-02-12"
7604 msgstr ""
7605
7606 #. type: Plain text
7607 #: build/C/man2/read.2:38
7608 msgid "read - read from a file descriptor"
7609 msgstr ""
7610
7611 #. type: Plain text
7612 #: build/C/man2/read.2:43
7613 #, no-wrap
7614 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
7615 msgstr ""
7616
7617 #. type: Plain text
7618 #: build/C/man2/read.2:52
7619 msgid ""
7620 "B<read>()  attempts to read up to I<count> bytes from file descriptor I<fd> "
7621 "into the buffer starting at I<buf>."
7622 msgstr ""
7623
7624 #. type: Plain text
7625 #: build/C/man2/read.2:60
7626 msgid ""
7627 "On files that support seeking, the read operation commences at the current "
7628 "file offset, and the file offset is incremented by the number of bytes "
7629 "read.  If the current file offset is at or past the end of file, no bytes "
7630 "are read, and B<read>()  returns zero."
7631 msgstr ""
7632
7633 #. type: Plain text
7634 #: build/C/man2/read.2:75
7635 msgid ""
7636 "If I<count> is zero, B<read>()  I<may> detect the errors described below.  "
7637 "In the absence of any errors, or if B<read>()  does not check for errors, a "
7638 "B<read>()  with a I<count> of 0 returns zero and has no other effects."
7639 msgstr ""
7640
7641 #. type: Plain text
7642 #: build/C/man2/read.2:81
7643 msgid "If I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
7644 msgstr ""
7645
7646 #. type: Plain text
7647 #: build/C/man2/read.2:95
7648 msgid ""
7649 "On success, the number of bytes read is returned (zero indicates end of "
7650 "file), and the file position is advanced by this number.  It is not an error "
7651 "if this number is smaller than the number of bytes requested; this may "
7652 "happen for example because fewer bytes are actually available right now "
7653 "(maybe because we were close to end-of-file, or because we are reading from "
7654 "a pipe, or from a terminal), or because B<read>()  was interrupted by a "
7655 "signal.  On error, -1 is returned, and I<errno> is set appropriately.  In "
7656 "this case it is left unspecified whether the file position (if any) changes."
7657 msgstr ""
7658
7659 #. type: TP
7660 #: build/C/man2/read.2:96 build/C/man3/scanf.3:548 build/C/man2/write.2:108
7661 #, no-wrap
7662 msgid "B<EAGAIN>"
7663 msgstr ""
7664
7665 #. type: Plain text
7666 #: build/C/man2/read.2:103
7667 msgid ""
7668 "The file descriptor I<fd> refers to a file other than a socket and has been "
7669 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
7670 msgstr ""
7671
7672 #. type: TP
7673 #: build/C/man2/read.2:103 build/C/man2/write.2:115
7674 #, no-wrap
7675 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
7676 msgstr ""
7677
7678 #.  Actually EAGAIN on Linux
7679 #. type: Plain text
7680 #: build/C/man2/read.2:114
7681 msgid ""
7682 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
7683 "(B<O_NONBLOCK>), and the read would block.  POSIX.1-2001 allows either error "
7684 "to be returned for this case, and does not require these constants to have "
7685 "the same value, so a portable application should check for both "
7686 "possibilities."
7687 msgstr ""
7688
7689 #. type: Plain text
7690 #: build/C/man2/read.2:118
7691 msgid "I<fd> is not a valid file descriptor or is not open for reading."
7692 msgstr ""
7693
7694 #. type: Plain text
7695 #: build/C/man2/read.2:122 build/C/man2/write.2:145
7696 msgid "I<buf> is outside your accessible address space."
7697 msgstr ""
7698
7699 #. type: Plain text
7700 #: build/C/man2/read.2:126
7701 msgid ""
7702 "The call was interrupted by a signal before any data was read; see "
7703 "B<signal>(7)."
7704 msgstr ""
7705
7706 #. type: Plain text
7707 #: build/C/man2/read.2:137
7708 msgid ""
7709 "I<fd> is attached to an object which is unsuitable for reading; or the file "
7710 "was opened with the B<O_DIRECT> flag, and either the address specified in "
7711 "I<buf>, the value specified in I<count>, or the current file offset is not "
7712 "suitably aligned."
7713 msgstr ""
7714
7715 #. type: Plain text
7716 #: build/C/man2/read.2:147
7717 msgid ""
7718 "I<fd> was created via a call to B<timerfd_create>(2)  and the wrong size "
7719 "buffer was given to B<read>(); see B<timerfd_create>(2)  for further "
7720 "information."
7721 msgstr ""
7722
7723 #. type: Plain text
7724 #: build/C/man2/read.2:158
7725 msgid ""
7726 "I/O error.  This will happen for example when the process is in a background "
7727 "process group, tries to read from its controlling terminal, and either it is "
7728 "ignoring or blocking B<SIGTTIN> or its process group is orphaned.  It may "
7729 "also occur when there is a low-level I/O error while reading from a disk or "
7730 "tape."
7731 msgstr ""
7732
7733 #. type: Plain text
7734 #: build/C/man2/read.2:162
7735 msgid "I<fd> refers to a directory."
7736 msgstr ""
7737
7738 #. type: Plain text
7739 #: build/C/man2/read.2:173
7740 msgid ""
7741 "Other errors may occur, depending on the object connected to I<fd>.  POSIX "
7742 "allows a B<read>()  that is interrupted after reading some data to return -1 "
7743 "(with I<errno> set to B<EINTR>)  or to return the number of bytes already "
7744 "read."
7745 msgstr ""
7746
7747 #. type: Plain text
7748 #: build/C/man2/read.2:187
7749 msgid ""
7750 "On NFS file systems, reading small amounts of data will update the timestamp "
7751 "only the first time, subsequent calls may not do so.  This is caused by "
7752 "client side attribute caching, because most if not all NFS clients leave "
7753 "st_atime (last file access time)  updates to the server and client side "
7754 "reads satisfied from the client's cache will not cause st_atime updates on "
7755 "the server as there are no server side reads.  UNIX semantics can be "
7756 "obtained by disabling client side attribute caching, but in most situations "
7757 "this will substantially increase server load and decrease performance."
7758 msgstr ""
7759
7760 #. type: Plain text
7761 #: build/C/man2/read.2:200
7762 msgid ""
7763 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
7764 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
7765 "B<fread>(3)"
7766 msgstr ""
7767
7768 #. type: TH
7769 #: build/C/man2/readlink.2:43
7770 #, no-wrap
7771 msgid "READLINK"
7772 msgstr ""
7773
7774 #. type: TH
7775 #: build/C/man2/readlink.2:43
7776 #, no-wrap
7777 msgid "2013-07-18"
7778 msgstr ""
7779
7780 #. type: Plain text
7781 #: build/C/man2/readlink.2:46
7782 msgid "readlink - read value of a symbolic link"
7783 msgstr ""
7784
7785 #. type: Plain text
7786 #: build/C/man2/readlink.2:50
7787 msgid ""
7788 "B<ssize_t readlink(const char *>I<path>B<, char *>I<buf>B<, size_t "
7789 ">I<bufsiz>B<);>"
7790 msgstr ""
7791
7792 #. type: Plain text
7793 #: build/C/man2/readlink.2:58
7794 msgid "B<readlink>():"
7795 msgstr ""
7796
7797 #. type: Plain text
7798 #: build/C/man2/readlink.2:61 build/C/man2/symlink.2:50
7799 msgid ""
7800 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7801 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
7802 msgstr ""
7803
7804 #. type: Plain text
7805 #: build/C/man2/readlink.2:77
7806 msgid ""
7807 "B<readlink>()  places the contents of the symbolic link I<path> in the "
7808 "buffer I<buf>, which has size I<bufsiz>.  B<readlink>()  does not append a "
7809 "null byte to I<buf>.  It will truncate the contents (to a length of "
7810 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
7811 "contents."
7812 msgstr ""
7813
7814 #. type: Plain text
7815 #: build/C/man2/readlink.2:85
7816 msgid ""
7817 "On success, B<readlink>()  returns the number of bytes placed in I<buf>.  On "
7818 "error, -1 is returned and I<errno> is set to indicate the error."
7819 msgstr ""
7820
7821 #. type: Plain text
7822 #: build/C/man2/readlink.2:91
7823 msgid ""
7824 "Search permission is denied for a component of the path prefix.  (See also "
7825 "B<path_resolution>(7).)"
7826 msgstr ""
7827
7828 #. type: Plain text
7829 #: build/C/man2/readlink.2:95
7830 msgid "I<buf> extends outside the process's allocated address space."
7831 msgstr ""
7832
7833 #.  At the glibc level, bufsiz is unsigned, so this error can only occur
7834 #.  if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
7835 #.  and this error can also occur if bufsiz < 0.
7836 #.  See: http://thread.gmane.org/gmane.linux.man/380
7837 #.  Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
7838 #. type: Plain text
7839 #: build/C/man2/readlink.2:104
7840 msgid "I<bufsiz> is not positive."
7841 msgstr ""
7842
7843 #. type: Plain text
7844 #: build/C/man2/readlink.2:107
7845 msgid "The named file is not a symbolic link."
7846 msgstr ""
7847
7848 #. type: Plain text
7849 #: build/C/man2/readlink.2:110
7850 msgid "An I/O error occurred while reading from the file system."
7851 msgstr ""
7852
7853 #. type: Plain text
7854 #: build/C/man2/readlink.2:113
7855 msgid "Too many symbolic links were encountered in translating the pathname."
7856 msgstr ""
7857
7858 #. type: Plain text
7859 #: build/C/man2/readlink.2:116
7860 msgid "A pathname, or a component of a pathname, was too long."
7861 msgstr ""
7862
7863 #. type: Plain text
7864 #: build/C/man2/readlink.2:119
7865 msgid "The named file does not exist."
7866 msgstr ""
7867
7868 #. type: Plain text
7869 #: build/C/man2/readlink.2:125
7870 msgid "A component of the path prefix is not a directory."
7871 msgstr ""
7872
7873 #. type: Plain text
7874 #: build/C/man2/readlink.2:130
7875 msgid "4.4BSD (B<readlink>()  first appeared in 4.2BSD), POSIX.1-2001."
7876 msgstr ""
7877
7878 #. type: Plain text
7879 #: build/C/man2/readlink.2:138
7880 msgid ""
7881 "In versions of glibc up to and including glibc 2.4, the return type of "
7882 "B<readlink>()  was declared as I<int>.  Nowadays, the return type is "
7883 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
7884 msgstr ""
7885
7886 #. type: Plain text
7887 #: build/C/man2/readlink.2:157
7888 msgid ""
7889 "Using a statically sized buffer might not provide enough room for the "
7890 "symbolic link contents.  The required size for the buffer can be obtained "
7891 "from the I<stat.st_size> value returned by a call to B<lstat>(2)  on the "
7892 "link.  However, the number of bytes written by B<readlink>()  should be "
7893 "checked to make sure that the size of the symbolic link did not increase "
7894 "between the calls.  Dynamically allocating the buffer for B<readlink>()  "
7895 "also addresses a common portability problem when using I<PATH_MAX> for the "
7896 "buffer size, as this constant is not guaranteed to be defined per POSIX if "
7897 "the system does not have such limit."
7898 msgstr ""
7899
7900 #. type: Plain text
7901 #: build/C/man2/readlink.2:163
7902 msgid ""
7903 "The following program allocates the buffer needed by B<readlink>()  "
7904 "dynamically from the information provided by B<lstat>(), making sure there's "
7905 "no race condition between the calls."
7906 msgstr ""
7907
7908 #. type: Plain text
7909 #: build/C/man2/readlink.2:170
7910 #, no-wrap
7911 msgid ""
7912 "#include E<lt>sys/types.hE<gt>\n"
7913 "#include E<lt>sys/stat.hE<gt>\n"
7914 "#include E<lt>stdio.hE<gt>\n"
7915 "#include E<lt>stdlib.hE<gt>\n"
7916 "#include E<lt>unistd.hE<gt>\n"
7917 msgstr ""
7918
7919 #. type: Plain text
7920 #: build/C/man2/readlink.2:177
7921 #, no-wrap
7922 msgid ""
7923 "int\n"
7924 "main(int argc, char *argv[])\n"
7925 "{\n"
7926 "    struct stat sb;\n"
7927 "    char *linkname;\n"
7928 "    ssize_t r;\n"
7929 msgstr ""
7930
7931 #. type: Plain text
7932 #: build/C/man2/readlink.2:182
7933 #, no-wrap
7934 msgid ""
7935 "    if (argc != 2) {\n"
7936 "        fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
7937 "        exit(EXIT_FAILURE);\n"
7938 "    }\n"
7939 msgstr ""
7940
7941 #. type: Plain text
7942 #: build/C/man2/readlink.2:187
7943 #, no-wrap
7944 msgid ""
7945 "    if (lstat(argv[1], &sb) == -1) {\n"
7946 "        perror(\"lstat\");\n"
7947 "        exit(EXIT_FAILURE);\n"
7948 "    }\n"
7949 msgstr ""
7950
7951 #. type: Plain text
7952 #: build/C/man2/readlink.2:193
7953 #, no-wrap
7954 msgid ""
7955 "    linkname = malloc(sb.st_size + 1);\n"
7956 "    if (linkname == NULL) {\n"
7957 "        fprintf(stderr, \"insufficient memory\\en\");\n"
7958 "        exit(EXIT_FAILURE);\n"
7959 "    }\n"
7960 msgstr ""
7961
7962 #. type: Plain text
7963 #: build/C/man2/readlink.2:195
7964 #, no-wrap
7965 msgid "    r = readlink(argv[1], linkname, sb.st_size + 1);\n"
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man2/readlink.2:200
7970 #, no-wrap
7971 msgid ""
7972 "    if (r == -1) {\n"
7973 "        perror(\"lstat\");\n"
7974 "        exit(EXIT_FAILURE);\n"
7975 "    }\n"
7976 msgstr ""
7977
7978 #. type: Plain text
7979 #: build/C/man2/readlink.2:206
7980 #, no-wrap
7981 msgid ""
7982 "    if (r E<gt> sb.st_size) {\n"
7983 "        fprintf(stderr, \"symlink increased in size \"\n"
7984 "                        \"between lstat() and readlink()\\en\");\n"
7985 "        exit(EXIT_FAILURE);\n"
7986 "    }\n"
7987 msgstr ""
7988
7989 #. type: Plain text
7990 #: build/C/man2/readlink.2:208
7991 #, no-wrap
7992 msgid "    linkname[r] = \\(aq\\e0\\(aq;\n"
7993 msgstr ""
7994
7995 #. type: Plain text
7996 #: build/C/man2/readlink.2:210
7997 #, no-wrap
7998 msgid ""
7999 "    printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], "
8000 "linkname);\n"
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man2/readlink.2:222
8005 msgid ""
8006 "B<readlink>(1), B<lstat>(2), B<readlinkat>(2), B<stat>(2), B<symlink>(2), "
8007 "B<path_resolution>(7), B<symlink>(7)"
8008 msgstr ""
8009
8010 #. type: TH
8011 #: build/C/man2/readv.2:32
8012 #, no-wrap
8013 msgid "READV"
8014 msgstr ""
8015
8016 #. type: TH
8017 #: build/C/man2/readv.2:32
8018 #, no-wrap
8019 msgid "2010-11-17"
8020 msgstr ""
8021
8022 #. type: Plain text
8023 #: build/C/man2/readv.2:35
8024 msgid "readv, writev, preadv, pwritev - read or write data into multiple buffers"
8025 msgstr ""
8026
8027 #. type: Plain text
8028 #: build/C/man2/readv.2:38
8029 #, no-wrap
8030 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
8031 msgstr ""
8032
8033 #. type: Plain text
8034 #: build/C/man2/readv.2:40
8035 #, no-wrap
8036 msgid ""
8037 "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
8038 ">I<iovcnt>B<);>\n"
8039 msgstr ""
8040
8041 #. type: Plain text
8042 #: build/C/man2/readv.2:42
8043 #, no-wrap
8044 msgid ""
8045 "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
8046 ">I<iovcnt>B<);>\n"
8047 msgstr ""
8048
8049 #. type: Plain text
8050 #: build/C/man2/readv.2:45
8051 #, no-wrap
8052 msgid ""
8053 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
8054 ">I<iovcnt>B<,>\n"
8055 "B<               off_t >I<offset>B<);>\n"
8056 msgstr ""
8057
8058 #. type: Plain text
8059 #: build/C/man2/readv.2:48
8060 #, no-wrap
8061 msgid ""
8062 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
8063 ">I<iovcnt>B<,>\n"
8064 "B<                off_t >I<offset>B<);>\n"
8065 msgstr ""
8066
8067 #. type: Plain text
8068 #: build/C/man2/readv.2:58
8069 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
8070 msgstr ""
8071
8072 #. type: Plain text
8073 #: build/C/man2/readv.2:68
8074 msgid ""
8075 "The B<readv>()  system call reads I<iovcnt> buffers from the file associated "
8076 "with the file descriptor I<fd> into the buffers described by I<iov> "
8077 "(\"scatter input\")."
8078 msgstr ""
8079
8080 #. type: Plain text
8081 #: build/C/man2/readv.2:78
8082 msgid ""
8083 "The B<writev>()  system call writes I<iovcnt> buffers of data described by "
8084 "I<iov> to the file associated with the file descriptor I<fd> (\"gather "
8085 "output\")."
8086 msgstr ""
8087
8088 #. type: Plain text
8089 #: build/C/man2/readv.2:87
8090 msgid ""
8091 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
8092 "I<E<lt>sys/uio.hE<gt>> as:"
8093 msgstr ""
8094
8095 #. type: Plain text
8096 #: build/C/man2/readv.2:95
8097 #, no-wrap
8098 msgid ""
8099 "struct iovec {\n"
8100 "    void  *iov_base;    /* Starting address */\n"
8101 "    size_t iov_len;     /* Number of bytes to transfer */\n"
8102 "};\n"
8103 msgstr ""
8104
8105 #. type: Plain text
8106 #: build/C/man2/readv.2:103
8107 msgid ""
8108 "The B<readv>()  system call works just like B<read>(2)  except that multiple "
8109 "buffers are filled."
8110 msgstr ""
8111
8112 #. type: Plain text
8113 #: build/C/man2/readv.2:109
8114 msgid ""
8115 "The B<writev>()  system call works just like B<write>(2)  except that "
8116 "multiple buffers are written out."
8117 msgstr ""
8118
8119 #. type: Plain text
8120 #: build/C/man2/readv.2:128
8121 msgid ""
8122 "Buffers are processed in array order.  This means that B<readv>()  "
8123 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on.  (If "
8124 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
8125 "filled.)  Similarly, B<writev>()  writes out the entire contents of "
8126 "I<iov>[0] before proceeding to I<iov>[1], and so on."
8127 msgstr ""
8128
8129 #. type: Plain text
8130 #: build/C/man2/readv.2:146
8131 msgid ""
8132 "The data transfers performed by B<readv>()  and B<writev>()  are atomic: the "
8133 "data written by B<writev>()  is written as a single block that is not "
8134 "intermingled with output from writes in other processes (but see B<pipe>(7)  "
8135 "for an exception); analogously, B<readv>()  is guaranteed to read a "
8136 "contiguous block of data from the file, regardless of read operations "
8137 "performed in other threads or processes that have file descriptors referring "
8138 "to the same open file description (see B<open>(2))."
8139 msgstr ""
8140
8141 #. type: SS
8142 #: build/C/man2/readv.2:146
8143 #, no-wrap
8144 msgid "preadv() and pwritev()"
8145 msgstr ""
8146
8147 #. type: Plain text
8148 #: build/C/man2/readv.2:159
8149 msgid ""
8150 "The B<preadv>()  system call combines the functionality of B<readv>()  and "
8151 "B<pread>(2).  It performs the same task as B<readv>(), but adds a fourth "
8152 "argument, I<offset>, which specifies the file offset at which the input "
8153 "operation is to be performed."
8154 msgstr ""
8155
8156 #. type: Plain text
8157 #: build/C/man2/readv.2:172
8158 msgid ""
8159 "The B<pwritev>()  system call combines the functionality of B<writev>()  and "
8160 "B<pwrite>(2).  It performs the same task as B<writev>(), but adds a fourth "
8161 "argument, I<offset>, which specifies the file offset at which the output "
8162 "operation is to be performed."
8163 msgstr ""
8164
8165 #. type: Plain text
8166 #: build/C/man2/readv.2:177
8167 msgid ""
8168 "The file offset is not changed by these system calls.  The file referred to "
8169 "by I<fd> must be capable of seeking."
8170 msgstr ""
8171
8172 #. type: Plain text
8173 #: build/C/man2/readv.2:188
8174 msgid ""
8175 "On success, B<readv>()  and B<preadv>()  return the number of bytes read; "
8176 "B<writev>()  and B<pwritev>()  return the number of bytes written.  On "
8177 "error, -1 is returned, and I<errno> is set appropriately."
8178 msgstr ""
8179
8180 #. type: Plain text
8181 #: build/C/man2/readv.2:200
8182 msgid ""
8183 "The errors are as given for B<read>(2)  and B<write>(2).  Furthermore, "
8184 "B<preadv>()  and B<pwritev>()  can also fail for the same reasons as "
8185 "B<lseek>(2).  Additionally, the following error is defined:"
8186 msgstr ""
8187
8188 #. type: Plain text
8189 #: build/C/man2/readv.2:209
8190 msgid ""
8191 "The sum of the I<iov_len> values overflows an I<ssize_t> value.  Or, the "
8192 "vector count I<iovcnt> is less than zero or greater than the permitted "
8193 "maximum."
8194 msgstr ""
8195
8196 #. type: Plain text
8197 #: build/C/man2/readv.2:214
8198 msgid ""
8199 "B<preadv>()  and B<pwritev>()  first appeared in Linux 2.6.30; library "
8200 "support was added in glibc 2.10."
8201 msgstr ""
8202
8203 #.  The readv/writev system calls were buggy before Linux 1.3.40.
8204 #.  (Says release.libc.)
8205 #. type: Plain text
8206 #: build/C/man2/readv.2:222
8207 msgid ""
8208 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
8209 "4.2BSD), POSIX.1-2001.  Linux libc5 used I<size_t> as the type of the "
8210 "I<iovcnt> argument, and I<int> as the return type."
8211 msgstr ""
8212
8213 #. type: Plain text
8214 #: build/C/man2/readv.2:226
8215 msgid "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
8216 msgstr ""
8217
8218 #. type: SS
8219 #: build/C/man2/readv.2:227
8220 #, no-wrap
8221 msgid "Linux notes"
8222 msgstr ""
8223
8224 #. type: Plain text
8225 #: build/C/man2/readv.2:258
8226 msgid ""
8227 "POSIX.1-2001 allows an implementation to place a limit on the number of "
8228 "items that can be passed in I<iov>.  An implementation can advertise its "
8229 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
8230 "return value from I<sysconf(_SC_IOV_MAX)>.  On Linux, the limit advertised "
8231 "by these mechanisms is 1024, which is the true kernel limit.  However, the "
8232 "glibc wrapper functions do some extra work if they detect that the "
8233 "underlying kernel system call failed because this limit was exceeded.  In "
8234 "the case of B<readv>()  the wrapper function allocates a temporary buffer "
8235 "large enough for all of the items specified by I<iov>, passes that buffer in "
8236 "a call to B<read>(2), copies data from the buffer to the locations specified "
8237 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
8238 "buffer.  The wrapper function for B<writev>()  performs the analogous task "
8239 "using a temporary buffer and a call to B<write>(2)."
8240 msgstr ""
8241
8242 #. type: Plain text
8243 #: build/C/man2/readv.2:265
8244 msgid ""
8245 "It is not advisable to mix calls to B<readv>()  or B<writev>(), which "
8246 "operate on file descriptors, with the functions from the stdio library; the "
8247 "results will be undefined and probably not what you want."
8248 msgstr ""
8249
8250 #. type: Plain text
8251 #: build/C/man2/readv.2:268
8252 msgid "The following code sample demonstrates the use of B<writev>():"
8253 msgstr ""
8254
8255 #. type: Plain text
8256 #: build/C/man2/readv.2:275
8257 #, no-wrap
8258 msgid ""
8259 "char *str0 = \"hello \";\n"
8260 "char *str1 = \"world\\en\";\n"
8261 "struct iovec iov[2];\n"
8262 "ssize_t nwritten;\n"
8263 msgstr ""
8264
8265 #. type: Plain text
8266 #: build/C/man2/readv.2:280
8267 #, no-wrap
8268 msgid ""
8269 "iov[0].iov_base = str0;\n"
8270 "iov[0].iov_len = strlen(str0);\n"
8271 "iov[1].iov_base = str1;\n"
8272 "iov[1].iov_len = strlen(str1);\n"
8273 msgstr ""
8274
8275 #. type: Plain text
8276 #: build/C/man2/readv.2:282
8277 #, no-wrap
8278 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
8279 msgstr ""
8280
8281 #. type: Plain text
8282 #: build/C/man2/readv.2:288
8283 msgid "B<pread>(2), B<read>(2), B<write>(2)"
8284 msgstr ""
8285
8286 #. type: TH
8287 #: build/C/man3/remove.3:31
8288 #, no-wrap
8289 msgid "REMOVE"
8290 msgstr ""
8291
8292 #. type: TH
8293 #: build/C/man3/remove.3:31
8294 #, no-wrap
8295 msgid "2008-12-03"
8296 msgstr ""
8297
8298 #. type: Plain text
8299 #: build/C/man3/remove.3:34
8300 msgid "remove - remove a file or directory"
8301 msgstr ""
8302
8303 #. type: Plain text
8304 #: build/C/man3/remove.3:38
8305 msgid "B<int remove(const char *>I<pathname>B<);>"
8306 msgstr ""
8307
8308 #. type: Plain text
8309 #: build/C/man3/remove.3:46
8310 msgid ""
8311 "B<remove>()  deletes a name from the file system.  It calls B<unlink>(2)  "
8312 "for files, and B<rmdir>(2)  for directories."
8313 msgstr ""
8314
8315 #. type: Plain text
8316 #: build/C/man3/remove.3:50
8317 msgid ""
8318 "If the removed name was the last link to a file and no processes have the "
8319 "file open, the file is deleted and the space it was using is made available "
8320 "for reuse."
8321 msgstr ""
8322
8323 #. type: Plain text
8324 #: build/C/man3/remove.3:55
8325 msgid ""
8326 "If the name was the last link to a file, but any processes still have the "
8327 "file open, the file will remain in existence until the last file descriptor "
8328 "referring to it is closed."
8329 msgstr ""
8330
8331 #. type: Plain text
8332 #: build/C/man3/remove.3:57
8333 msgid "If the name referred to a symbolic link, the link is removed."
8334 msgstr ""
8335
8336 #. type: Plain text
8337 #: build/C/man3/remove.3:60
8338 msgid ""
8339 "If the name referred to a socket, FIFO, or device, the name is removed, but "
8340 "processes which have the object open may continue to use it."
8341 msgstr ""
8342
8343 #. type: Plain text
8344 #: build/C/man3/remove.3:70
8345 msgid "The errors that occur are those for B<unlink>(2)  and B<rmdir>(2)."
8346 msgstr ""
8347
8348 #. type: Plain text
8349 #: build/C/man3/remove.3:72
8350 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
8351 msgstr ""
8352
8353 #. type: Plain text
8354 #: build/C/man3/remove.3:78
8355 msgid ""
8356 "Under libc4 and libc5, B<remove>()  was an alias for B<unlink>(2)  (and "
8357 "hence would not remove directories)."
8358 msgstr ""
8359
8360 #. type: Plain text
8361 #: build/C/man3/remove.3:81 build/C/man2/unlink.2:148
8362 msgid ""
8363 "Infelicities in the protocol underlying NFS can cause the unexpected "
8364 "disappearance of files which are still being used."
8365 msgstr ""
8366
8367 #. type: Plain text
8368 #: build/C/man3/remove.3:92
8369 msgid ""
8370 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
8371 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
8372 msgstr ""
8373
8374 #. type: TH
8375 #: build/C/man2/rename.2:32
8376 #, no-wrap
8377 msgid "RENAME"
8378 msgstr ""
8379
8380 #. type: Plain text
8381 #: build/C/man2/rename.2:35
8382 msgid "rename - change the name or location of a file"
8383 msgstr ""
8384
8385 #. type: Plain text
8386 #: build/C/man2/rename.2:39
8387 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
8388 msgstr ""
8389
8390 #. type: Plain text
8391 #: build/C/man2/rename.2:48
8392 msgid ""
8393 "B<rename>()  renames a file, moving it between directories if required.  Any "
8394 "other hard links to the file (as created using B<link>(2))  are unaffected.  "
8395 "Open file descriptors for I<oldpath> are also unaffected."
8396 msgstr ""
8397
8398 #. type: Plain text
8399 #: build/C/man2/rename.2:56
8400 msgid ""
8401 "If I<newpath> already exists it will be atomically replaced (subject to a "
8402 "few conditions; see ERRORS below), so that there is no point at which "
8403 "another process attempting to access I<newpath> will find it missing."
8404 msgstr ""
8405
8406 #. type: Plain text
8407 #: build/C/man2/rename.2:64
8408 msgid ""
8409 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
8410 "file, then B<rename>()  does nothing, and returns a success status."
8411 msgstr ""
8412
8413 #. type: Plain text
8414 #: build/C/man2/rename.2:72
8415 msgid ""
8416 "If I<newpath> exists but the operation fails for some reason B<rename>()  "
8417 "guarantees to leave an instance of I<newpath> in place."
8418 msgstr ""
8419
8420 #. type: Plain text
8421 #: build/C/man2/rename.2:78
8422 msgid ""
8423 "I<oldpath> can specify a directory.  In this case, I<newpath> must either "
8424 "not exist, or it must specify an empty directory."
8425 msgstr ""
8426
8427 #. type: Plain text
8428 #: build/C/man2/rename.2:85
8429 msgid ""
8430 "However, when overwriting there will probably be a window in which both "
8431 "I<oldpath> and I<newpath> refer to the file being renamed."
8432 msgstr ""
8433
8434 #. type: Plain text
8435 #: build/C/man2/rename.2:91
8436 msgid ""
8437 "If I<oldpath> refers to a symbolic link the link is renamed; if I<newpath> "
8438 "refers to a symbolic link the link will be overwritten."
8439 msgstr ""
8440
8441 #. type: Plain text
8442 #: build/C/man2/rename.2:116
8443 msgid ""
8444 "Write permission is denied for the directory containing I<oldpath> or "
8445 "I<newpath>, or, search permission is denied for one of the directories in "
8446 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
8447 "and does not allow write permission (needed to update the I<..> entry).  "
8448 "(See also B<path_resolution>(7).)"
8449 msgstr ""
8450
8451 #. type: TP
8452 #: build/C/man2/rename.2:116 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:71
8453 #, no-wrap
8454 msgid "B<EBUSY>"
8455 msgstr ""
8456
8457 #. type: Plain text
8458 #: build/C/man2/rename.2:133
8459 msgid ""
8460 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
8461 "use by some process (perhaps as current working directory, or as root "
8462 "directory, or because it was open for reading) or is in use by the system "
8463 "(for example as mount point), while the system considers this an error.  "
8464 "(Note that there is no requirement to return B<EBUSY> in such "
8465 "cases\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
8466 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
8467 "situations.)"
8468 msgstr ""
8469
8470 #. type: Plain text
8471 #: build/C/man2/rename.2:143
8472 msgid ""
8473 "The new pathname contained a path prefix of the old, or, more generally, an "
8474 "attempt was made to make a directory a subdirectory of itself."
8475 msgstr ""
8476
8477 #. type: Plain text
8478 #: build/C/man2/rename.2:149
8479 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
8480 msgstr ""
8481
8482 #. type: Plain text
8483 #: build/C/man2/rename.2:160
8484 msgid ""
8485 "I<oldpath> already has the maximum number of links to it, or it was a "
8486 "directory and the directory containing I<newpath> has the maximum number of "
8487 "links."
8488 msgstr ""
8489
8490 #. type: Plain text
8491 #: build/C/man2/rename.2:176
8492 msgid ""
8493 "The link named by I<oldpath> does not exist; or, a directory component in "
8494 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
8495 msgstr ""
8496
8497 #. type: Plain text
8498 #: build/C/man2/rename.2:193
8499 msgid ""
8500 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
8501 "a directory.  Or, I<oldpath> is a directory, and I<newpath> exists but is "
8502 "not a directory."
8503 msgstr ""
8504
8505 #. type: TP
8506 #: build/C/man2/rename.2:193
8507 #, no-wrap
8508 msgid "B<ENOTEMPTY> or B<EEXIST>"
8509 msgstr ""
8510
8511 #. type: Plain text
8512 #: build/C/man2/rename.2:197
8513 msgid ""
8514 "I<newpath> is a nonempty directory, that is, contains entries other than "
8515 "\".\" and \"..\"."
8516 msgstr ""
8517
8518 #. type: TP
8519 #: build/C/man2/rename.2:197 build/C/man2/unlink.2:126
8520 #, no-wrap
8521 msgid "B<EPERM> or B<EACCES>"
8522 msgstr ""
8523
8524 #. type: Plain text
8525 #: build/C/man2/rename.2:221
8526 msgid ""
8527 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>)  set and "
8528 "the process's effective user ID is neither the user ID of the file to be "
8529 "deleted nor that of the directory containing it, and the process is not "
8530 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
8531 "I<newpath> is an existing file and the directory containing it has the "
8532 "sticky bit set and the process's effective user ID is neither the user ID of "
8533 "the file to be replaced nor that of the directory containing it, and the "
8534 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
8535 "capability); or the file system containing I<pathname> does not support "
8536 "renaming of the type requested."
8537 msgstr ""
8538
8539 #. type: Plain text
8540 #: build/C/man2/rename.2:232
8541 msgid ""
8542 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
8543 "permits a file system to be mounted at multiple points, but B<rename>()  "
8544 "does not work across different mount points, even if the same file system is "
8545 "mounted on both.)"
8546 msgstr ""
8547
8548 #. type: Plain text
8549 #: build/C/man2/rename.2:234
8550 msgid "4.3BSD, C89, C99, POSIX.1-2001."
8551 msgstr ""
8552
8553 #. type: Plain text
8554 #: build/C/man2/rename.2:245
8555 msgid ""
8556 "On NFS file systems, you can not assume that if the operation failed the "
8557 "file was not renamed.  If the server does the rename operation and then "
8558 "crashes, the retransmitted RPC which will be processed when the server is up "
8559 "again causes a failure.  The application is expected to deal with this.  See "
8560 "B<link>(2)  for a similar problem."
8561 msgstr ""
8562
8563 #. type: Plain text
8564 #: build/C/man2/rename.2:254
8565 msgid ""
8566 "B<mv>(1), B<chmod>(2), B<link>(2), B<renameat>(2), B<symlink>(2), "
8567 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
8568 msgstr ""
8569
8570 #. type: TH
8571 #: build/C/man2/rmdir.2:30
8572 #, no-wrap
8573 msgid "RMDIR"
8574 msgstr ""
8575
8576 #. type: TH
8577 #: build/C/man2/rmdir.2:30
8578 #, no-wrap
8579 msgid "2008-05-08"
8580 msgstr ""
8581
8582 #. type: Plain text
8583 #: build/C/man2/rmdir.2:33
8584 msgid "rmdir - delete a directory"
8585 msgstr ""
8586
8587 #. type: Plain text
8588 #: build/C/man2/rmdir.2:37
8589 msgid "B<int rmdir(const char *>I<pathname>B<);>"
8590 msgstr ""
8591
8592 #. type: Plain text
8593 #: build/C/man2/rmdir.2:40
8594 msgid "B<rmdir>()  deletes a directory, which must be empty."
8595 msgstr ""
8596
8597 #. type: Plain text
8598 #: build/C/man2/rmdir.2:55
8599 msgid ""
8600 "Write access to the directory containing I<pathname> was not allowed, or one "
8601 "of the directories in the path prefix of I<pathname> did not allow search "
8602 "permission.  (See also B<path_resolution>(7)."
8603 msgstr ""
8604
8605 #. type: Plain text
8606 #: build/C/man2/rmdir.2:64
8607 msgid ""
8608 "I<pathname> is currently in use by the system or some process that prevents "
8609 "its removal.  On Linux this means I<pathname> is currently used as a mount "
8610 "point or is the root directory of the calling process."
8611 msgstr ""
8612
8613 #. type: Plain text
8614 #: build/C/man2/rmdir.2:73
8615 msgid "I<pathname> has I<.> as last component."
8616 msgstr ""
8617
8618 #. type: Plain text
8619 #: build/C/man2/rmdir.2:77
8620 msgid "Too many symbolic links were encountered in resolving I<pathname>."
8621 msgstr ""
8622
8623 #. type: Plain text
8624 #: build/C/man2/rmdir.2:85
8625 msgid ""
8626 "A directory component in I<pathname> does not exist or is a dangling "
8627 "symbolic link."
8628 msgstr ""
8629
8630 #. type: Plain text
8631 #: build/C/man2/rmdir.2:94
8632 msgid ""
8633 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
8634 "fact, a directory."
8635 msgstr ""
8636
8637 #. type: TP
8638 #: build/C/man2/rmdir.2:94
8639 #, no-wrap
8640 msgid "B<ENOTEMPTY>"
8641 msgstr ""
8642
8643 #. type: Plain text
8644 #: build/C/man2/rmdir.2:107
8645 msgid ""
8646 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
8647 "I<..> as its final component.  POSIX.1-2001 also allows B<EEXIST> for this "
8648 "condition."
8649 msgstr ""
8650
8651 #. type: Plain text
8652 #: build/C/man2/rmdir.2:118
8653 msgid ""
8654 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
8655 "and the process's effective user ID is neither the user ID of the file to be "
8656 "deleted nor that of the directory containing it, and the process is not "
8657 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
8658 msgstr ""
8659
8660 #. type: Plain text
8661 #: build/C/man2/rmdir.2:123
8662 msgid ""
8663 "The file system containing I<pathname> does not support the removal of "
8664 "directories."
8665 msgstr ""
8666
8667 #. type: Plain text
8668 #: build/C/man2/rmdir.2:127
8669 msgid "I<pathname> refers to a directory on a read-only file system."
8670 msgstr ""
8671
8672 #. type: Plain text
8673 #: build/C/man2/rmdir.2:132
8674 msgid ""
8675 "Infelicities in the protocol underlying NFS can cause the unexpected "
8676 "disappearance of directories which are still being used."
8677 msgstr ""
8678
8679 #. type: Plain text
8680 #: build/C/man2/rmdir.2:141
8681 msgid ""
8682 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
8683 "B<unlink>(2), B<unlinkat>(2)"
8684 msgstr ""
8685
8686 #. type: TH
8687 #: build/C/man3/scanf.3:52
8688 #, no-wrap
8689 msgid "SCANF"
8690 msgstr ""
8691
8692 #. type: TH
8693 #: build/C/man3/scanf.3:52
8694 #, no-wrap
8695 msgid "2013-01-30"
8696 msgstr ""
8697
8698 #. type: Plain text
8699 #: build/C/man3/scanf.3:55
8700 msgid "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
8701 msgstr ""
8702
8703 #. type: Plain text
8704 #: build/C/man3/scanf.3:62
8705 #, no-wrap
8706 msgid ""
8707 "B<int scanf(const char *>I<format>B<, ...);>\n"
8708 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
8709 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
8710 msgstr ""
8711
8712 #. type: Plain text
8713 #: build/C/man3/scanf.3:64
8714 #, no-wrap
8715 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
8716 msgstr ""
8717
8718 #. type: Plain text
8719 #: build/C/man3/scanf.3:68
8720 #, no-wrap
8721 msgid ""
8722 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
8723 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list "
8724 ">I<ap>B<);>\n"
8725 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
8726 ">I<ap>B<);>\n"
8727 msgstr ""
8728
8729 #. type: Plain text
8730 #: build/C/man3/scanf.3:79
8731 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
8732 msgstr ""
8733
8734 #. type: Plain text
8735 #: build/C/man3/scanf.3:82
8736 msgid ""
8737 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
8738 "200112L;"
8739 msgstr ""
8740
8741 #. type: Plain text
8742 #: build/C/man3/scanf.3:104
8743 msgid ""
8744 "The B<scanf>()  family of functions scans input according to I<format> as "
8745 "described below.  This format may contain I<conversion specifications>; the "
8746 "results from such conversions, if any, are stored in the locations pointed "
8747 "to by the I<pointer> arguments that follow I<format>.  Each I<pointer> "
8748 "argument must be of a type that is appropriate for the value returned by the "
8749 "corresponding conversion specification."
8750 msgstr ""
8751
8752 #. type: Plain text
8753 #: build/C/man3/scanf.3:115
8754 msgid ""
8755 "If the number of conversion specifications in I<format> exceeds the number "
8756 "of I<pointer> arguments, the results are undefined.  If the number of "
8757 "I<pointer> arguments exceeds the number of conversion specifications, then "
8758 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
8759 msgstr ""
8760
8761 #. type: Plain text
8762 #: build/C/man3/scanf.3:127
8763 msgid ""
8764 "The B<scanf>()  function reads input from the standard input stream "
8765 "I<stdin>, B<fscanf>()  reads input from the stream pointer I<stream>, and "
8766 "B<sscanf>()  reads its input from the character string pointed to by I<str>."
8767 msgstr ""
8768
8769 #. type: Plain text
8770 #: build/C/man3/scanf.3:145
8771 msgid ""
8772 "The B<vfscanf>()  function is analogous to B<vfprintf>(3)  and reads input "
8773 "from the stream pointer I<stream> using a variable argument list of pointers "
8774 "(see B<stdarg>(3).  The B<vscanf>()  function scans a variable argument list "
8775 "from the standard input and the B<vsscanf>()  function scans it from a "
8776 "string; these are analogous to the B<vprintf>(3)  and B<vsprintf>(3)  "
8777 "functions respectively."
8778 msgstr ""
8779
8780 #. type: Plain text
8781 #: build/C/man3/scanf.3:159
8782 msgid ""
8783 "The I<format> string consists of a sequence of I<directives> which describe "
8784 "how to process the sequence of input characters.  If processing of a "
8785 "directive fails, no further input is read, and B<scanf>()  returns.  A "
8786 "\"failure\" can be either of the following: I<input failure>, meaning that "
8787 "input characters were unavailable, or I<matching failure>, meaning that the "
8788 "input was inappropriate (see below)."
8789 msgstr ""
8790
8791 #. type: Plain text
8792 #: build/C/man3/scanf.3:161
8793 msgid "A directive is one of the following:"
8794 msgstr ""
8795
8796 #. type: TP
8797 #: build/C/man3/scanf.3:161 build/C/man3/scanf.3:167 build/C/man3/scanf.3:171 build/C/man3/scanf.3:190 build/C/man3/scanf.3:201 build/C/man3/scanf.3:220 build/C/man3/scanf.3:232 build/C/man3/scanf.3:246
8798 #, no-wrap
8799 msgid "\\(bu"
8800 msgstr ""
8801
8802 #. type: Plain text
8803 #: build/C/man3/scanf.3:167
8804 msgid ""
8805 "A sequence of white-space characters (space, tab, newline, etc.; see "
8806 "B<isspace>(3)).  This directive matches any amount of white space, including "
8807 "none, in the input."
8808 msgstr ""
8809
8810 #. type: Plain text
8811 #: build/C/man3/scanf.3:171
8812 msgid ""
8813 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq).  "
8814 "This character must exactly match the next character of input."
8815 msgstr ""
8816
8817 #. type: Plain text
8818 #: build/C/man3/scanf.3:182
8819 msgid ""
8820 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
8821 "character.  A sequence of characters from the input is converted according "
8822 "to this specification, and the result is placed in the corresponding "
8823 "I<pointer> argument.  If the next item of input does not match the "
8824 "conversion specification, the conversion fails\\(emthis is a I<matching "
8825 "failure>."
8826 msgstr ""
8827
8828 #. type: Plain text
8829 #: build/C/man3/scanf.3:190
8830 msgid ""
8831 "Each I<conversion specification> in I<format> begins with either the "
8832 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
8833 "for the distinction) followed by:"
8834 msgstr ""
8835
8836 #. type: Plain text
8837 #: build/C/man3/scanf.3:201
8838 msgid ""
8839 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>()  reads "
8840 "input as directed by the conversion specification, but discards the input.  "
8841 "No corresponding I<pointer> argument is required, and this specification is "
8842 "not included in the count of successful assignments returned by B<scanf>()."
8843 msgstr ""
8844
8845 #. type: Plain text
8846 #: build/C/man3/scanf.3:220
8847 msgid ""
8848 "An optional \\(aqm\\(aq character.  This is used with string conversions "
8849 "(I<%s>, I<%c>, I<%[>), and relieves the caller of the need to allocate a "
8850 "corresponding buffer to hold the input: instead, B<scanf>()  allocates a "
8851 "buffer of sufficient size, and assigns the address of this buffer to the "
8852 "corresponding I<pointer> argument, which should be a pointer to a I<char\\ "
8853 "*> variable (this variable does not need to be initialized before the "
8854 "call).  The caller should subsequently B<free>(3)  this buffer when it is no "
8855 "longer required."
8856 msgstr ""
8857
8858 #. type: Plain text
8859 #: build/C/man3/scanf.3:232
8860 msgid ""
8861 "An optional decimal integer which specifies the I<maximum field width>.  "
8862 "Reading of characters stops either when this maximum is reached or when a "
8863 "nonmatching character is found, whichever happens first.  Most conversions "
8864 "discard initial white space characters (the exceptions are noted below), and "
8865 "these discarded characters don't count toward the maximum field width.  "
8866 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq)  to "
8867 "mark the end of the input; the maximum field width does not include this "
8868 "terminator."
8869 msgstr ""
8870
8871 #. type: Plain text
8872 #: build/C/man3/scanf.3:246
8873 msgid ""
8874 "An optional I<type modifier character>.  For example, the B<l> type modifier "
8875 "is used with integer conversions such as B<%d> to specify that the "
8876 "corresponding I<pointer> argument refers to a I<long int> rather than a "
8877 "pointer to an I<int>."
8878 msgstr ""
8879
8880 #. type: Plain text
8881 #: build/C/man3/scanf.3:251
8882 msgid ""
8883 "A I<conversion specifier> that specifies the type of input conversion to be "
8884 "performed."
8885 msgstr ""
8886
8887 #. type: Plain text
8888 #: build/C/man3/scanf.3:280
8889 msgid ""
8890 "The conversion specifications in I<format> are of two forms, either "
8891 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\".  The two "
8892 "forms should not be mixed in the same I<format> string, except that a string "
8893 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>.  If "
8894 "I<format> contains \\(aq%\\(aq specifications then these correspond in order "
8895 "with successive I<pointer> arguments.  In the \"B<%>I<n>B<$>\" form (which "
8896 "is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer that "
8897 "specifies that the converted input should be placed in the location referred "
8898 "to by the I<n>-th I<pointer> argument following I<format>."
8899 msgstr ""
8900
8901 #. type: SS
8902 #: build/C/man3/scanf.3:280
8903 #, no-wrap
8904 msgid "Conversions"
8905 msgstr ""
8906
8907 #. type: Plain text
8908 #: build/C/man3/scanf.3:284
8909 msgid ""
8910 "The following I<type modifier characters> can appear in a conversion "
8911 "specification:"
8912 msgstr ""
8913
8914 #. type: Plain text
8915 #: build/C/man3/scanf.3:294
8916 msgid ""
8917 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
8918 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
8919 "I<unsigned short int> (rather than I<int>)."
8920 msgstr ""
8921
8922 #. type: Plain text
8923 #: build/C/man3/scanf.3:302
8924 msgid ""
8925 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
8926 "I<unsigned char>."
8927 msgstr ""
8928
8929 #. type: Plain text
8930 #: build/C/man3/scanf.3:311
8931 msgid ""
8932 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
8933 "I<uintmax_t>.  This modifier was introduced in C99."
8934 msgstr ""
8935
8936 #.  This use of l was introduced in Amendment 1 to ISO C90.
8937 #. type: Plain text
8938 #: build/C/man3/scanf.3:338
8939 msgid ""
8940 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
8941 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
8942 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
8943 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
8944 "(rather than I<float>).  Specifying two B<l> characters is equivalent to "
8945 "B<L>.  If used with B<%c> or B<%s> the corresponding parameter is considered "
8946 "as a pointer to a wide character or wide-character string respectively."
8947 msgstr ""
8948
8949 #.  MTK, Jul 05: The following is no longer true for modern
8950 #.  ANSI C (i.e., C99):
8951 #.  (Note that long long is not an
8952 #.  ANSI C
8953 #.  type. Any program using this will not be portable to all
8954 #.  architectures).
8955 #. type: Plain text
8956 #: build/C/man3/scanf.3:354
8957 msgid ""
8958 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
8959 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
8960 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
8961 msgstr ""
8962
8963 #. type: Plain text
8964 #: build/C/man3/scanf.3:359
8965 msgid "equivalent to B<L>.  This specifier does not exist in ANSI C."
8966 msgstr ""
8967
8968 #. type: Plain text
8969 #: build/C/man3/scanf.3:366
8970 msgid ""
8971 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>.  This "
8972 "modifier was introduced in C99."
8973 msgstr ""
8974
8975 #. type: Plain text
8976 #: build/C/man3/scanf.3:373
8977 msgid ""
8978 "As for B<h>, but the next pointer is a pointer to a I<size_t>.  This "
8979 "modifier was introduced in C99."
8980 msgstr ""
8981
8982 #. type: Plain text
8983 #: build/C/man3/scanf.3:377
8984 msgid "The following I<conversion specifiers> are available:"
8985 msgstr ""
8986
8987 #. type: Plain text
8988 #: build/C/man3/scanf.3:386
8989 msgid ""
8990 "Matches a literal \\(aq%\\(aq.  That is, B<%\\&%> in the format string "
8991 "matches a single input \\(aq%\\(aq character.  No conversion is done (but "
8992 "initial white space characters are discarded), and assignment does not "
8993 "occur."
8994 msgstr ""
8995
8996 #. type: TP
8997 #: build/C/man3/scanf.3:386
8998 #, no-wrap
8999 msgid "B<d>"
9000 msgstr ""
9001
9002 #. type: Plain text
9003 #: build/C/man3/scanf.3:391
9004 msgid ""
9005 "Matches an optionally signed decimal integer; the next pointer must be a "
9006 "pointer to I<int>."
9007 msgstr ""
9008
9009 #. type: TP
9010 #: build/C/man3/scanf.3:391
9011 #, no-wrap
9012 msgid "B<D>"
9013 msgstr ""
9014
9015 #. type: Plain text
9016 #: build/C/man3/scanf.3:400
9017 msgid ""
9018 "Equivalent to I<ld>; this exists only for backward compatibility.  (Note: "
9019 "thus only in libc4.  In libc5 and glibc the B<%D> is silently ignored, "
9020 "causing old programs to fail mysteriously.)"
9021 msgstr ""
9022
9023 #. type: TP
9024 #: build/C/man3/scanf.3:400
9025 #, no-wrap
9026 msgid "B<i>"
9027 msgstr ""
9028
9029 #. type: Plain text
9030 #: build/C/man3/scanf.3:412
9031 msgid ""
9032 "Matches an optionally signed integer; the next pointer must be a pointer to "
9033 "I<int>.  The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
9034 "base 8 if it begins with I<0>, and in base 10 otherwise.  Only characters "
9035 "that correspond to the base are used."
9036 msgstr ""
9037
9038 #. type: TP
9039 #: build/C/man3/scanf.3:412
9040 #, no-wrap
9041 msgid "B<o>"
9042 msgstr ""
9043
9044 #. type: Plain text
9045 #: build/C/man3/scanf.3:416
9046 msgid ""
9047 "Matches an unsigned octal integer; the next pointer must be a pointer to "
9048 "I<unsigned int>."
9049 msgstr ""
9050
9051 #. type: TP
9052 #: build/C/man3/scanf.3:416
9053 #, no-wrap
9054 msgid "B<u>"
9055 msgstr ""
9056
9057 #. type: Plain text
9058 #: build/C/man3/scanf.3:421
9059 msgid ""
9060 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
9061 "I<unsigned int>."
9062 msgstr ""
9063
9064 #. type: Plain text
9065 #: build/C/man3/scanf.3:426
9066 msgid ""
9067 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
9068 "to I<unsigned int>."
9069 msgstr ""
9070
9071 #. type: TP
9072 #: build/C/man3/scanf.3:426
9073 #, no-wrap
9074 msgid "B<X>"
9075 msgstr ""
9076
9077 #. type: Plain text
9078 #: build/C/man3/scanf.3:430
9079 msgid "Equivalent to B<x>."
9080 msgstr ""
9081
9082 #. type: TP
9083 #: build/C/man3/scanf.3:430
9084 #, no-wrap
9085 msgid "B<f>"
9086 msgstr ""
9087
9088 #. type: Plain text
9089 #: build/C/man3/scanf.3:435
9090 msgid ""
9091 "Matches an optionally signed floating-point number; the next pointer must be "
9092 "a pointer to I<float>."
9093 msgstr ""
9094
9095 #. type: TP
9096 #: build/C/man3/scanf.3:435
9097 #, no-wrap
9098 msgid "B<e>"
9099 msgstr ""
9100
9101 #. type: Plain text
9102 #: build/C/man3/scanf.3:439 build/C/man3/scanf.3:443 build/C/man3/scanf.3:447
9103 msgid "Equivalent to B<f>."
9104 msgstr ""
9105
9106 #. type: TP
9107 #: build/C/man3/scanf.3:439
9108 #, no-wrap
9109 msgid "B<g>"
9110 msgstr ""
9111
9112 #. type: TP
9113 #: build/C/man3/scanf.3:443
9114 #, no-wrap
9115 msgid "B<E>"
9116 msgstr ""
9117
9118 #. type: Plain text
9119 #: build/C/man3/scanf.3:451
9120 msgid "(C99) Equivalent to B<f>."
9121 msgstr ""
9122
9123 #. type: Plain text
9124 #: build/C/man3/scanf.3:459
9125 msgid ""
9126 "Matches a sequence of non-white-space characters; the next pointer must be a "
9127 "pointer to character array that is long enough to hold the input sequence "
9128 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
9129 "automatically.  The input string stops at white space or at the maximum "
9130 "field width, whichever occurs first."
9131 msgstr ""
9132
9133 #. type: Plain text
9134 #: build/C/man3/scanf.3:469
9135 msgid ""
9136 "Matches a sequence of characters whose length is specified by the I<maximum "
9137 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
9138 "there must be enough room for all the characters (no terminating null byte "
9139 "is added).  The usual skip of leading white space is suppressed.  To skip "
9140 "white space first, use an explicit space in the format."
9141 msgstr ""
9142
9143 #. type: TP
9144 #: build/C/man3/scanf.3:469
9145 #, no-wrap
9146 msgid "B<\\&[>"
9147 msgstr ""
9148
9149 #. type: Plain text
9150 #: build/C/man3/scanf.3:502
9151 msgid ""
9152 "Matches a nonempty sequence of characters from the specified set of accepted "
9153 "characters; the next pointer must be a pointer to I<char>, and there must be "
9154 "enough room for all the characters in the string, plus a terminating null "
9155 "byte.  The usual skip of leading white space is suppressed.  The string is "
9156 "to be made up of characters in (or not in) a particular set; the set is "
9157 "defined by the characters between the open bracket B<[> character and a "
9158 "close bracket B<]> character.  The set I<excludes> those characters if the "
9159 "first character after the open bracket is a circumflex (B<^>).  To include a "
9160 "close bracket in the set, make it the first character after the open bracket "
9161 "or the circumflex; any other position will end the set.  The hyphen "
9162 "character B<-> is also special; when placed between two other characters, it "
9163 "adds all intervening characters to the set.  To include a hyphen, make it "
9164 "the last character before the final close bracket.  For instance, "
9165 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
9166 "nine, and hyphen\".  The string ends with the appearance of a character not "
9167 "in the (or, with a circumflex, in) set or when the field width runs out."
9168 msgstr ""
9169
9170 #. type: Plain text
9171 #: build/C/man3/scanf.3:510
9172 msgid ""
9173 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
9174 "pointer must be a pointer to a pointer to I<void>."
9175 msgstr ""
9176
9177 #. type: Plain text
9178 #: build/C/man3/scanf.3:530
9179 msgid ""
9180 "Nothing is expected; instead, the number of characters consumed thus far "
9181 "from the input is stored through the next pointer, which must be a pointer "
9182 "to I<int>.  This is I<not> a conversion, although it can be suppressed with "
9183 "the B<*> assignment-suppression character.  The C standard says: \"Execution "
9184 "of a B<%n> directive does not increment the assignment count returned at the "
9185 "completion of execution\" but the Corrigendum seems to contradict this.  "
9186 "Probably it is wise not to make any assumptions on the effect of B<%n> "
9187 "conversions on the return value."
9188 msgstr ""
9189
9190 #. type: Plain text
9191 #: build/C/man3/scanf.3:535
9192 msgid ""
9193 "These functions return the number of input items successfully matched and "
9194 "assigned, which can be fewer than provided for, or even zero in the event of "
9195 "an early matching failure."
9196 msgstr ""
9197
9198 #. type: Plain text
9199 #: build/C/man3/scanf.3:547
9200 msgid ""
9201 "The value B<EOF> is returned if the end of input is reached before either "
9202 "the first successful conversion or a matching failure occurs.  B<EOF> is "
9203 "also returned if a read error occurs, in which case the error indicator for "
9204 "the stream (see B<ferror>(3))  is set, and I<errno> is set indicate the "
9205 "error."
9206 msgstr ""
9207
9208 #. type: Plain text
9209 #: build/C/man3/scanf.3:553
9210 msgid ""
9211 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
9212 "operation would block."
9213 msgstr ""
9214
9215 #. type: Plain text
9216 #: build/C/man3/scanf.3:558
9217 msgid ""
9218 "The file descriptor underlying I<stream> is invalid, or not open for "
9219 "reading."
9220 msgstr ""
9221
9222 #. type: Plain text
9223 #: build/C/man3/scanf.3:561
9224 msgid "Input byte sequence does not form a valid character."
9225 msgstr ""
9226
9227 #. type: Plain text
9228 #: build/C/man3/scanf.3:565
9229 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
9230 msgstr ""
9231
9232 #. type: Plain text
9233 #: build/C/man3/scanf.3:570
9234 msgid "Not enough arguments; or I<format> is NULL."
9235 msgstr ""
9236
9237 #. type: Plain text
9238 #: build/C/man3/scanf.3:573
9239 msgid "Out of memory."
9240 msgstr ""
9241
9242 #. type: TP
9243 #: build/C/man3/scanf.3:573
9244 #, no-wrap
9245 msgid "B<ERANGE>"
9246 msgstr ""
9247
9248 #. type: Plain text
9249 #: build/C/man3/scanf.3:577
9250 msgid ""
9251 "The result of an integer conversion would exceed the size that can be stored "
9252 "in the corresponding integer type."
9253 msgstr ""
9254
9255 #. type: Plain text
9256 #: build/C/man3/scanf.3:587
9257 msgid ""
9258 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>()  conform to C89 and "
9259 "C99 and POSIX.1-2001.  These standards do not specify the B<ERANGE> error."
9260 msgstr ""
9261
9262 #. type: Plain text
9263 #: build/C/man3/scanf.3:597
9264 msgid ""
9265 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
9266 "the usage of B<L> in integer conversions is the GNU notation."
9267 msgstr ""
9268
9269 #. type: Plain text
9270 #: build/C/man3/scanf.3:608
9271 msgid ""
9272 "The Linux version of these functions is based on the I<GNU> I<libio> "
9273 "library.  Take a look at the I<info> documentation of I<GNU> I<libc "
9274 "(glibc-1.08)> for a more concise description."
9275 msgstr ""
9276
9277 #. type: Plain text
9278 #: build/C/man3/scanf.3:614
9279 msgid ""
9280 "The GNU C library supported the dynamic allocation conversion specifier (as "
9281 "a nonstandard extension) via the B<a> character.  This feature seems to be "
9282 "present at least as far back as glibc 2.0."
9283 msgstr ""
9284
9285 #. type: Plain text
9286 #: build/C/man3/scanf.3:624
9287 msgid ""
9288 "It is not available if the program is compiled with I<gcc -std=c99> or I<gcc "
9289 "-D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also specified), in which case "
9290 "the B<a> is interpreted as a specifier for floating-point numbers (see "
9291 "above)."
9292 msgstr ""
9293
9294 #. type: Plain text
9295 #: build/C/man3/scanf.3:633
9296 msgid ""
9297 "Since version 2.7, glibc also provides the B<m> modifier for the same "
9298 "purpose as the B<a> modifier.  The B<m> modifier has the following "
9299 "advantages:"
9300 msgstr ""
9301
9302 #. type: Plain text
9303 #: build/C/man3/scanf.3:638
9304 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
9305 msgstr ""
9306
9307 #. type: Plain text
9308 #: build/C/man3/scanf.3:644
9309 msgid ""
9310 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
9311 "specifier (and is unaffected by I<gcc -std=c99> etc.)"
9312 msgstr ""
9313
9314 #. type: Plain text
9315 #: build/C/man3/scanf.3:646
9316 msgid "It is specified in the POSIX.1-2008 standard."
9317 msgstr ""
9318
9319 #. type: Plain text
9320 #: build/C/man3/scanf.3:659
9321 msgid ""
9322 "All functions are fully C89 conformant, but provide the additional "
9323 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
9324 "B<l> specifiers.  The latter may be considered to be a bug, as it changes "
9325 "the behavior of specifiers defined in C89."
9326 msgstr ""
9327
9328 #. type: Plain text
9329 #: build/C/man3/scanf.3:675
9330 msgid ""
9331 "Some combinations of the type modifiers and conversion specifiers defined by "
9332 "ANSI C do not make sense (e.g., B<%Ld>).  While they may have a well-defined "
9333 "behavior on Linux, this need not to be so on other architectures.  Therefore "
9334 "it usually is better to use modifiers that are not defined by ANSI C at all, "
9335 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
9336 "B<u>, B<x>, and B<X> conversions or B<ll>."
9337 msgstr ""
9338
9339 #. type: Plain text
9340 #: build/C/man3/scanf.3:681
9341 msgid ""
9342 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
9343 "conversions equivalently to B<L>."
9344 msgstr ""
9345
9346 #. type: Plain text
9347 #: build/C/man3/scanf.3:691
9348 msgid ""
9349 "To use the dynamic allocation conversion specifier, specify B<m> as a length "
9350 "modifier (thus B<%ms> or B<%m[>I<range>B<]>).  The caller must B<free>(3)  "
9351 "the returned string, as in the following example:"
9352 msgstr ""
9353
9354 #. type: Plain text
9355 #: build/C/man3/scanf.3:696
9356 #, no-wrap
9357 msgid ""
9358 "char *p;\n"
9359 "int n;\n"
9360 msgstr ""
9361
9362 #. type: Plain text
9363 #: build/C/man3/scanf.3:707
9364 #, no-wrap
9365 msgid ""
9366 "errno = 0;\n"
9367 "n = scanf(\"%m[a-z]\", &p);\n"
9368 "if (n == 1) {\n"
9369 "    printf(\"read: %s\\en\", p);\n"
9370 "    free(p);\n"
9371 "} else if (errno != 0) {\n"
9372 "    perror(\"scanf\");\n"
9373 "} else {\n"
9374 "    fprintf(stderr, \"No matching characters\\en\");\n"
9375 "}\n"
9376 msgstr ""
9377
9378 #. type: Plain text
9379 #: build/C/man3/scanf.3:715
9380 msgid ""
9381 "As shown in the above example, it is necessary to call B<free>(3)  only if "
9382 "the B<scanf>()  call successfully read a string."
9383 msgstr ""
9384
9385 #. type: Plain text
9386 #: build/C/man3/scanf.3:722
9387 msgid ""
9388 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
9389 "B<strtoul>(3)"
9390 msgstr ""
9391
9392 #. type: TH
9393 #: build/C/man3/setbuf.3:48
9394 #, no-wrap
9395 msgid "SETBUF"
9396 msgstr ""
9397
9398 #. type: TH
9399 #: build/C/man3/setbuf.3:48
9400 #, no-wrap
9401 msgid "2012-08-03"
9402 msgstr ""
9403
9404 #. type: Plain text
9405 #: build/C/man3/setbuf.3:51
9406 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
9407 msgstr ""
9408
9409 #. type: Plain text
9410 #: build/C/man3/setbuf.3:56
9411 #, no-wrap
9412 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
9413 msgstr ""
9414
9415 #. type: Plain text
9416 #: build/C/man3/setbuf.3:58
9417 #, no-wrap
9418 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
9419 msgstr ""
9420
9421 #. type: Plain text
9422 #: build/C/man3/setbuf.3:60
9423 #, no-wrap
9424 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
9425 msgstr ""
9426
9427 #. type: Plain text
9428 #: build/C/man3/setbuf.3:63
9429 #, no-wrap
9430 msgid ""
9431 "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t "
9432 ">I<size>B<);>\n"
9433 msgstr ""
9434
9435 #. type: Plain text
9436 #: build/C/man3/setbuf.3:73
9437 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
9438 msgstr ""
9439
9440 #. type: Plain text
9441 #: build/C/man3/setbuf.3:96
9442 msgid ""
9443 "The three types of buffering available are unbuffered, block buffered, and "
9444 "line buffered.  When an output stream is unbuffered, information appears on "
9445 "the destination file or terminal as soon as written; when it is block "
9446 "buffered many characters are saved up and written as a block; when it is "
9447 "line buffered characters are saved up until a newline is output or input is "
9448 "read from any stream attached to a terminal device (typically I<stdin>).  "
9449 "The function B<fflush>(3)  may be used to force the block out early.  (See "
9450 "B<fclose>(3).)  Normally all files are block buffered.  When the first I/O "
9451 "operation occurs on a file, B<malloc>(3)  is called, and a buffer is "
9452 "obtained.  If a stream refers to a terminal (as I<stdout> normally does) it "
9453 "is line buffered.  The standard error stream I<stderr> is always unbuffered "
9454 "by default."
9455 msgstr ""
9456
9457 #. type: Plain text
9458 #: build/C/man3/setbuf.3:103
9459 msgid ""
9460 "The B<setvbuf>()  function may be used on any open stream to change its "
9461 "buffer.  The I<mode> argument must be one of the following three macros:"
9462 msgstr ""
9463
9464 #. type: TP
9465 #: build/C/man3/setbuf.3:104
9466 #, no-wrap
9467 msgid "B<_IONBF>"
9468 msgstr ""
9469
9470 #. type: Plain text
9471 #: build/C/man3/setbuf.3:107
9472 msgid "unbuffered"
9473 msgstr ""
9474
9475 #. type: TP
9476 #: build/C/man3/setbuf.3:107
9477 #, no-wrap
9478 msgid "B<_IOLBF>"
9479 msgstr ""
9480
9481 #. type: Plain text
9482 #: build/C/man3/setbuf.3:110
9483 msgid "line buffered"
9484 msgstr ""
9485
9486 #. type: TP
9487 #: build/C/man3/setbuf.3:110
9488 #, no-wrap
9489 msgid "B<_IOFBF>"
9490 msgstr ""
9491
9492 #. type: Plain text
9493 #: build/C/man3/setbuf.3:113
9494 msgid "fully buffered"
9495 msgstr ""
9496
9497 #. type: Plain text
9498 #: build/C/man3/setbuf.3:129
9499 msgid ""
9500 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
9501 "least I<size> bytes long; this buffer will be used instead of the current "
9502 "buffer.  If the argument I<buf> is NULL, only the mode is affected; a new "
9503 "buffer will be allocated on the next read or write operation.  The "
9504 "B<setvbuf>()  function may be used only after opening a stream and before "
9505 "any other operations have been performed on it."
9506 msgstr ""
9507
9508 #. type: Plain text
9509 #: build/C/man3/setbuf.3:135
9510 msgid ""
9511 "The other three calls are, in effect, simply aliases for calls to "
9512 "B<setvbuf>().  The B<setbuf>()  function is exactly equivalent to the call"
9513 msgstr ""
9514
9515 #. type: Plain text
9516 #: build/C/man3/setbuf.3:138
9517 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
9518 msgstr ""
9519
9520 #. type: Plain text
9521 #: build/C/man3/setbuf.3:148
9522 msgid ""
9523 "The B<setbuffer>()  function is the same, except that the size of the buffer "
9524 "is up to the caller, rather than being determined by the default B<BUFSIZ>.  "
9525 "The B<setlinebuf>()  function is exactly equivalent to the call:"
9526 msgstr ""
9527
9528 #. type: Plain text
9529 #: build/C/man3/setbuf.3:151
9530 msgid "setvbuf(stream, NULL, _IOLBF, 0);"
9531 msgstr ""
9532
9533 #. type: Plain text
9534 #: build/C/man3/setbuf.3:162
9535 msgid ""
9536 "The function B<setvbuf>()  returns 0 on success.  It returns nonzero on "
9537 "failure (I<mode> is invalid or the request cannot be honored).  It may set "
9538 "I<errno> on failure."
9539 msgstr ""
9540
9541 #. type: Plain text
9542 #: build/C/man3/setbuf.3:164
9543 msgid "The other functions do not return a value."
9544 msgstr ""
9545
9546 #. type: Plain text
9547 #: build/C/man3/setbuf.3:170
9548 msgid "The B<setbuf>()  and B<setvbuf>()  functions conform to C89 and C99."
9549 msgstr ""
9550
9551 #. type: Plain text
9552 #: build/C/man3/setbuf.3:180
9553 msgid ""
9554 "The B<setbuffer>()  and B<setlinebuf>()  functions are not portable to "
9555 "versions of BSD before 4.2BSD, and are available under Linux since libc "
9556 "4.5.21.  On 4.2BSD and 4.3BSD systems, B<setbuf>()  always uses a suboptimal "
9557 "buffer size and should be avoided."
9558 msgstr ""
9559
9560 #. type: Plain text
9561 #: build/C/man3/setbuf.3:187
9562 msgid ""
9563 "You must make sure that the space that I<buf> points to still exists by the "
9564 "time I<stream> is closed, which also happens at program termination.  For "
9565 "example, the following is invalid:"
9566 msgstr ""
9567
9568 #. type: Plain text
9569 #: build/C/man3/setbuf.3:190
9570 #, no-wrap
9571 msgid "#include E<lt>stdio.hE<gt>\n"
9572 msgstr ""
9573
9574 #. type: Plain text
9575 #: build/C/man3/setbuf.3:199
9576 #, no-wrap
9577 msgid ""
9578 "int\n"
9579 "main(void)\n"
9580 "{\n"
9581 "    char buf[BUFSIZ];\n"
9582 "    setbuf(stdin, buf);\n"
9583 "    printf(\"Hello, world!\\en\");\n"
9584 "    return 0;\n"
9585 "}\n"
9586 msgstr ""
9587
9588 #. type: Plain text
9589 #: build/C/man3/setbuf.3:208
9590 msgid ""
9591 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
9592 "B<printf>(3), B<puts>(3)"
9593 msgstr ""
9594
9595 #. type: TH
9596 #: build/C/man3/stdin.3:13
9597 #, no-wrap
9598 msgid "STDIN"
9599 msgstr ""
9600
9601 #. type: TH
9602 #: build/C/man3/stdin.3:13 build/C/man3/tmpfile.3:31
9603 #, no-wrap
9604 msgid "2008-07-14"
9605 msgstr ""
9606
9607 #. type: Plain text
9608 #: build/C/man3/stdin.3:16
9609 msgid "stdin, stdout, stderr - standard I/O streams"
9610 msgstr ""
9611
9612 #. type: Plain text
9613 #: build/C/man3/stdin.3:23
9614 #, no-wrap
9615 msgid ""
9616 "B<extern FILE *>I<stdin>B<;>\n"
9617 "B<extern FILE *>I<stdout>B<;>\n"
9618 "B<extern FILE *>I<stderr>B<;>\n"
9619 msgstr ""
9620
9621 #. type: Plain text
9622 #: build/C/man3/stdin.3:35
9623 msgid ""
9624 "Under normal circumstances every UNIX program has three streams opened for "
9625 "it when it starts up, one for input, one for output, and one for printing "
9626 "diagnostic or error messages.  These are typically attached to the user's "
9627 "terminal (see B<tty>(4)  but might instead refer to files or other devices, "
9628 "depending on what the parent process chose to set up.  (See also the "
9629 "\"Redirection\" section of B<sh>(1).)"
9630 msgstr ""
9631
9632 #. type: Plain text
9633 #: build/C/man3/stdin.3:45
9634 msgid ""
9635 "The input stream is referred to as \"standard input\"; the output stream is "
9636 "referred to as \"standard output\"; and the error stream is referred to as "
9637 "\"standard error\".  These terms are abbreviated to form the symbols used to "
9638 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
9639 msgstr ""
9640
9641 #. type: Plain text
9642 #: build/C/man3/stdin.3:54
9643 msgid ""
9644 "Each of these symbols is a B<stdio>(3)  macro of type pointer to I<FILE>, "
9645 "and can be used with functions like B<fprintf>(3)  or B<fread>(3)."
9646 msgstr ""
9647
9648 #. type: Plain text
9649 #: build/C/man3/stdin.3:63
9650 msgid ""
9651 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
9652 "same underlying files may also be accessed using the raw UNIX file "
9653 "interface, that is, the functions like B<read>(2)  and B<lseek>(2)."
9654 msgstr ""
9655
9656 #. type: Plain text
9657 #: build/C/man3/stdin.3:82
9658 msgid ""
9659 "On program startup, the integer file descriptors associated with the streams "
9660 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively.  The "
9661 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
9662 "are defined with these values in I<E<lt>unistd.hE<gt>>.  (Applying "
9663 "B<freopen>(3)  to one of these streams can change the file descriptor number "
9664 "associated with the stream.)"
9665 msgstr ""
9666
9667 #. type: Plain text
9668 #: build/C/man3/stdin.3:95
9669 msgid ""
9670 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
9671 "unexpected results and should generally be avoided.  (For the masochistic "
9672 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
9673 "is supposed to work.)  A general rule is that file descriptors are handled "
9674 "in the kernel, while stdio is just a library.  This means for example, that "
9675 "after an B<exec>(3), the child inherits all open file descriptors, but all "
9676 "old streams have become inaccessible."
9677 msgstr ""
9678
9679 #. type: Plain text
9680 #: build/C/man3/stdin.3:113
9681 msgid ""
9682 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
9683 "macros, assigning to them is nonportable.  The standard streams can be made "
9684 "to refer to different files with help of the library function B<freopen>(3), "
9685 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
9686 "and I<stderr>.  The standard streams are closed by a call to B<exit>(3)  and "
9687 "by normal program termination."
9688 msgstr ""
9689
9690 #. type: Plain text
9691 #: build/C/man3/stdin.3:122
9692 msgid ""
9693 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
9694 "standard also stipulates that these three streams shall be open at program "
9695 "startup."
9696 msgstr ""
9697
9698 #. type: Plain text
9699 #: build/C/man3/stdin.3:154
9700 msgid ""
9701 "The stream I<stderr> is unbuffered.  The stream I<stdout> is line-buffered "
9702 "when it points to a terminal.  Partial lines will not appear until "
9703 "B<fflush>(3)  or B<exit>(3)  is called, or a newline is printed.  This can "
9704 "produce unexpected results, especially with debugging output.  The buffering "
9705 "mode of the standard streams (or any other stream)  can be changed using the "
9706 "B<setbuf>(3)  or B<setvbuf>(3)  call.  Note that in case I<stdin> is "
9707 "associated with a terminal, there may also be input buffering in the "
9708 "terminal driver, entirely unrelated to stdio buffering.  (Indeed, normally "
9709 "terminal input is line buffered in the kernel.)  This kernel input handling "
9710 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
9711 "B<termios>(3)."
9712 msgstr ""
9713
9714 #. type: Plain text
9715 #: build/C/man3/stdin.3:160
9716 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
9717 msgstr ""
9718
9719 #. type: TH
9720 #: build/C/man3/stdio.3:39
9721 #, no-wrap
9722 msgid "STDIO"
9723 msgstr ""
9724
9725 #. type: TH
9726 #: build/C/man3/stdio.3:39
9727 #, no-wrap
9728 msgid "2001-12-26"
9729 msgstr ""
9730
9731 #. type: Plain text
9732 #: build/C/man3/stdio.3:42
9733 msgid "stdio - standard input/output library functions"
9734 msgstr ""
9735
9736 #. type: Plain text
9737 #: build/C/man3/stdio.3:46
9738 msgid "B<FILE *>I<stdin>B<;>"
9739 msgstr ""
9740
9741 #. type: Plain text
9742 #: build/C/man3/stdio.3:48
9743 msgid "B<FILE *>I<stdout>B<;>"
9744 msgstr ""
9745
9746 #. type: Plain text
9747 #: build/C/man3/stdio.3:50
9748 msgid "B<FILE *>I<stderr>B<;>"
9749 msgstr ""
9750
9751 #. type: Plain text
9752 #: build/C/man3/stdio.3:57
9753 msgid ""
9754 "The standard I/O library provides a simple and efficient buffered stream I/O "
9755 "interface.  Input and output is mapped into logical data streams and the "
9756 "physical I/O characteristics are concealed.  The functions and macros are "
9757 "listed below; more information is available from the individual man pages."
9758 msgstr ""
9759
9760 #. type: Plain text
9761 #: build/C/man3/stdio.3:80
9762 msgid ""
9763 "A stream is associated with an external file (which may be a physical "
9764 "device) by I<opening> a file, which may involve creating a new file.  "
9765 "Creating an existing file causes its former contents to be discarded.  If a "
9766 "file can support positioning requests (such as a disk file, as opposed to a "
9767 "terminal) then a I<file position indicator> associated with the stream is "
9768 "positioned at the start of the file (byte zero), unless the file is opened "
9769 "with append mode.  If append mode is used, it is unspecified whether the "
9770 "position indicator will be placed at the start or the end of the file.  The "
9771 "position indicator is maintained by subsequent reads, writes and positioning "
9772 "requests.  All input occurs as if the characters were read by successive "
9773 "calls to the B<fgetc>(3)  function; all output takes place as if all "
9774 "characters were written by successive calls to the B<fputc>(3)  function."
9775 msgstr ""
9776
9777 #. type: Plain text
9778 #: build/C/man3/stdio.3:90
9779 msgid ""
9780 "A file is disassociated from a stream by I<closing> the file.  Output "
9781 "streams are flushed (any unwritten buffer contents are transferred to the "
9782 "host environment) before the stream is disassociated from the file.  The "
9783 "value of a pointer to a I<FILE> object is indeterminate after a file is "
9784 "closed (garbage)."
9785 msgstr ""
9786
9787 #. type: Plain text
9788 #: build/C/man3/stdio.3:103
9789 msgid ""
9790 "A file may be subsequently reopened, by the same or another program "
9791 "execution, and its contents reclaimed or modified (if it can be repositioned "
9792 "at the start).  If the main function returns to its original caller, or the "
9793 "B<exit>(3)  function is called, all open files are closed (hence all output "
9794 "streams are flushed) before program termination.  Other methods of program "
9795 "termination, such as B<abort>(3)  do not bother about closing files "
9796 "properly."
9797 msgstr ""
9798
9799 #. type: Plain text
9800 #: build/C/man3/stdio.3:119
9801 msgid ""
9802 "At program startup, three text streams are predefined and need not be opened "
9803 "explicitly: I<standard input> (for reading conventional input), I<standard "
9804 "output> (for writing conventional input), and I<standard error> (for writing "
9805 "diagnostic output).  These streams are abbreviated I<stdin>,I<stdout> and "
9806 "I<stderr>.  When opened, the standard error stream is not fully buffered; "
9807 "the standard input and output streams are fully buffered if and only if the "
9808 "streams do not refer to an interactive device."
9809 msgstr ""
9810
9811 #. type: Plain text
9812 #: build/C/man3/stdio.3:129
9813 msgid ""
9814 "Output streams that refer to terminal devices are always line buffered by "
9815 "default; pending output to such streams is written automatically whenever an "
9816 "input stream that refers to a terminal device is read.  In cases where a "
9817 "large amount of computation is done after printing part of a line on an "
9818 "output terminal, it is necessary to B<fflush>(3)  the standard output before "
9819 "going off and computing so that the output will appear."
9820 msgstr ""
9821
9822 #. type: Plain text
9823 #: build/C/man3/stdio.3:143
9824 msgid ""
9825 "The I<stdio> library is a part of the library B<libc> and routines are "
9826 "automatically loaded as needed by the compilers B<cc>(1)  and B<pc>(1).  The "
9827 "SYNOPSIS sections of the following manual pages indicate which include files "
9828 "are to be used, what the compiler declaration for the function looks like "
9829 "and which external variables are of interest."
9830 msgstr ""
9831
9832 #.  Not on Linux: .BR fropen ,
9833 #.  Not on Linux: .BR fwopen ,
9834 #. type: Plain text
9835 #: build/C/man3/stdio.3:183
9836 msgid ""
9837 "The following are defined as macros; these names may not be reused without "
9838 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
9839 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
9840 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
9841 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
9842 "B<stderr>, B<stdin>, B<stdout>.  Function versions of the macro functions "
9843 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
9844 "and B<putchar> exist and will be used if the macros definitions are "
9845 "explicitly removed."
9846 msgstr ""
9847
9848 #. type: SS
9849 #: build/C/man3/stdio.3:183
9850 #, no-wrap
9851 msgid "List of functions"
9852 msgstr ""
9853
9854 #. type: tbl table
9855 #: build/C/man3/stdio.3:188
9856 #, no-wrap
9857 msgid "Function\tDescription\n"
9858 msgstr ""
9859
9860 #. type: tbl table
9861 #: build/C/man3/stdio.3:189
9862 #, no-wrap
9863 msgid "_\n"
9864 msgstr ""
9865
9866 #. type: tbl table
9867 #: build/C/man3/stdio.3:190
9868 #, no-wrap
9869 msgid "clearerr\tcheck and reset stream status\n"
9870 msgstr ""
9871
9872 #. type: tbl table
9873 #: build/C/man3/stdio.3:191
9874 #, no-wrap
9875 msgid "fclose\tclose a stream\n"
9876 msgstr ""
9877
9878 #. type: tbl table
9879 #: build/C/man3/stdio.3:192
9880 #, no-wrap
9881 msgid "fdopen\tstream open functions\n"
9882 msgstr ""
9883
9884 #. type: tbl table
9885 #: build/C/man3/stdio.3:193
9886 #, no-wrap
9887 msgid "feof\tcheck and reset stream status\n"
9888 msgstr ""
9889
9890 #. type: tbl table
9891 #: build/C/man3/stdio.3:194
9892 #, no-wrap
9893 msgid "ferror\tcheck and reset stream status\n"
9894 msgstr ""
9895
9896 #. type: tbl table
9897 #: build/C/man3/stdio.3:195
9898 #, no-wrap
9899 msgid "fflush\tflush a stream\n"
9900 msgstr ""
9901
9902 #. type: tbl table
9903 #: build/C/man3/stdio.3:196
9904 #, no-wrap
9905 msgid "fgetc\tget next character or word from input stream\n"
9906 msgstr ""
9907
9908 #. type: tbl table
9909 #: build/C/man3/stdio.3:197
9910 #, no-wrap
9911 msgid "fgetpos\treposition a stream\n"
9912 msgstr ""
9913
9914 #. type: tbl table
9915 #: build/C/man3/stdio.3:198
9916 #, no-wrap
9917 msgid "fgets\tget a line from a stream\n"
9918 msgstr ""
9919
9920 #. type: tbl table
9921 #: build/C/man3/stdio.3:199
9922 #, no-wrap
9923 msgid "fileno\treturn the integer descriptor of the argument stream\n"
9924 msgstr ""
9925
9926 #. type: tbl table
9927 #: build/C/man3/stdio.3:200
9928 #, no-wrap
9929 msgid "fopen\tstream open functions\n"
9930 msgstr ""
9931
9932 #. type: tbl table
9933 #: build/C/man3/stdio.3:201
9934 #, no-wrap
9935 msgid "fprintf\tformatted output conversion\n"
9936 msgstr ""
9937
9938 #. type: tbl table
9939 #: build/C/man3/stdio.3:202
9940 #, no-wrap
9941 msgid "fpurge\tflush a stream\n"
9942 msgstr ""
9943
9944 #. type: tbl table
9945 #: build/C/man3/stdio.3:203
9946 #, no-wrap
9947 msgid "fputc\toutput a character or word to a stream\n"
9948 msgstr ""
9949
9950 #. type: tbl table
9951 #: build/C/man3/stdio.3:204
9952 #, no-wrap
9953 msgid "fputs\toutput a line to a stream\n"
9954 msgstr ""
9955
9956 #. type: tbl table
9957 #: build/C/man3/stdio.3:205
9958 #, no-wrap
9959 msgid "fread\tbinary stream input/output\n"
9960 msgstr ""
9961
9962 #. type: tbl table
9963 #: build/C/man3/stdio.3:206
9964 #, no-wrap
9965 msgid "freopen\tstream open functions\n"
9966 msgstr ""
9967
9968 #. type: tbl table
9969 #: build/C/man3/stdio.3:207
9970 #, no-wrap
9971 msgid "fscanf\tinput format conversion\n"
9972 msgstr ""
9973
9974 #. type: tbl table
9975 #: build/C/man3/stdio.3:208
9976 #, no-wrap
9977 msgid "fseek\treposition a stream\n"
9978 msgstr ""
9979
9980 #. type: tbl table
9981 #: build/C/man3/stdio.3:209
9982 #, no-wrap
9983 msgid "fsetpos\treposition a stream\n"
9984 msgstr ""
9985
9986 #. type: tbl table
9987 #: build/C/man3/stdio.3:210
9988 #, no-wrap
9989 msgid "ftell\treposition a stream\n"
9990 msgstr ""
9991
9992 #. type: tbl table
9993 #: build/C/man3/stdio.3:211
9994 #, no-wrap
9995 msgid "fwrite\tbinary stream input/output\n"
9996 msgstr ""
9997
9998 #. type: tbl table
9999 #: build/C/man3/stdio.3:212
10000 #, no-wrap
10001 msgid "getc\tget next character or word from input stream\n"
10002 msgstr ""
10003
10004 #. type: tbl table
10005 #: build/C/man3/stdio.3:213
10006 #, no-wrap
10007 msgid "getchar\tget next character or word from input stream\n"
10008 msgstr ""
10009
10010 #. type: tbl table
10011 #: build/C/man3/stdio.3:214
10012 #, no-wrap
10013 msgid "gets\tget a line from a stream\n"
10014 msgstr ""
10015
10016 #. type: tbl table
10017 #: build/C/man3/stdio.3:215
10018 #, no-wrap
10019 msgid "getw\tget next character or word from input stream\n"
10020 msgstr ""
10021
10022 #. type: tbl table
10023 #: build/C/man3/stdio.3:216
10024 #, no-wrap
10025 msgid "mktemp\tmake temporary filename (unique)\n"
10026 msgstr ""
10027
10028 #. type: tbl table
10029 #: build/C/man3/stdio.3:217
10030 #, no-wrap
10031 msgid "perror\tsystem error messages\n"
10032 msgstr ""
10033
10034 #. type: tbl table
10035 #: build/C/man3/stdio.3:218
10036 #, no-wrap
10037 msgid "printf\tformatted output conversion\n"
10038 msgstr ""
10039
10040 #. type: tbl table
10041 #: build/C/man3/stdio.3:219
10042 #, no-wrap
10043 msgid "putc\toutput a character or word to a stream\n"
10044 msgstr ""
10045
10046 #. type: tbl table
10047 #: build/C/man3/stdio.3:220
10048 #, no-wrap
10049 msgid "putchar\toutput a character or word to a stream\n"
10050 msgstr ""
10051
10052 #. type: tbl table
10053 #: build/C/man3/stdio.3:221
10054 #, no-wrap
10055 msgid "puts\toutput a line to a stream\n"
10056 msgstr ""
10057
10058 #. type: tbl table
10059 #: build/C/man3/stdio.3:222
10060 #, no-wrap
10061 msgid "putw\toutput a character or word to a stream\n"
10062 msgstr ""
10063
10064 #. type: tbl table
10065 #: build/C/man3/stdio.3:223
10066 #, no-wrap
10067 msgid "remove\tremove directory entry\n"
10068 msgstr ""
10069
10070 #. type: tbl table
10071 #: build/C/man3/stdio.3:224
10072 #, no-wrap
10073 msgid "rewind\treposition a stream\n"
10074 msgstr ""
10075
10076 #. type: tbl table
10077 #: build/C/man3/stdio.3:225
10078 #, no-wrap
10079 msgid "scanf\tinput format conversion\n"
10080 msgstr ""
10081
10082 #. type: tbl table
10083 #: build/C/man3/stdio.3:226
10084 #, no-wrap
10085 msgid "setbuf\tstream buffering operations\n"
10086 msgstr ""
10087
10088 #. type: tbl table
10089 #: build/C/man3/stdio.3:227
10090 #, no-wrap
10091 msgid "setbuffer\tstream buffering operations\n"
10092 msgstr ""
10093
10094 #. type: tbl table
10095 #: build/C/man3/stdio.3:228
10096 #, no-wrap
10097 msgid "setlinebuf\tstream buffering operations\n"
10098 msgstr ""
10099
10100 #. type: tbl table
10101 #: build/C/man3/stdio.3:229
10102 #, no-wrap
10103 msgid "setvbuf\tstream buffering operations\n"
10104 msgstr ""
10105
10106 #. type: tbl table
10107 #: build/C/man3/stdio.3:230
10108 #, no-wrap
10109 msgid "sprintf\tformatted output conversion\n"
10110 msgstr ""
10111
10112 #. type: tbl table
10113 #: build/C/man3/stdio.3:231
10114 #, no-wrap
10115 msgid "sscanf\tinput format conversion\n"
10116 msgstr ""
10117
10118 #. type: tbl table
10119 #: build/C/man3/stdio.3:232
10120 #, no-wrap
10121 msgid "strerror\tsystem error messages\n"
10122 msgstr ""
10123
10124 #. type: tbl table
10125 #: build/C/man3/stdio.3:233
10126 #, no-wrap
10127 msgid "sys_errlist\tsystem error messages\n"
10128 msgstr ""
10129
10130 #. type: tbl table
10131 #: build/C/man3/stdio.3:234
10132 #, no-wrap
10133 msgid "sys_nerr\tsystem error messages\n"
10134 msgstr ""
10135
10136 #. type: tbl table
10137 #: build/C/man3/stdio.3:235
10138 #, no-wrap
10139 msgid "tempnam\ttemporary file routines\n"
10140 msgstr ""
10141
10142 #. type: tbl table
10143 #: build/C/man3/stdio.3:236
10144 #, no-wrap
10145 msgid "tmpfile\ttemporary file routines\n"
10146 msgstr ""
10147
10148 #. type: tbl table
10149 #: build/C/man3/stdio.3:237
10150 #, no-wrap
10151 msgid "tmpnam\ttemporary file routines\n"
10152 msgstr ""
10153
10154 #. type: tbl table
10155 #: build/C/man3/stdio.3:238
10156 #, no-wrap
10157 msgid "ungetc\tun-get character from input stream\n"
10158 msgstr ""
10159
10160 #. type: tbl table
10161 #: build/C/man3/stdio.3:239
10162 #, no-wrap
10163 msgid "vfprintf\tformatted output conversion\n"
10164 msgstr ""
10165
10166 #. type: tbl table
10167 #: build/C/man3/stdio.3:240
10168 #, no-wrap
10169 msgid "vfscanf\tinput format conversion\n"
10170 msgstr ""
10171
10172 #. type: tbl table
10173 #: build/C/man3/stdio.3:241
10174 #, no-wrap
10175 msgid "vprintf\tformatted output conversion\n"
10176 msgstr ""
10177
10178 #. type: tbl table
10179 #: build/C/man3/stdio.3:242
10180 #, no-wrap
10181 msgid "vscanf\tinput format conversion\n"
10182 msgstr ""
10183
10184 #. type: tbl table
10185 #: build/C/man3/stdio.3:243
10186 #, no-wrap
10187 msgid "vsprintf\tformatted output conversion\n"
10188 msgstr ""
10189
10190 #. type: tbl table
10191 #: build/C/man3/stdio.3:244
10192 #, no-wrap
10193 msgid "vsscanf\tinput format conversion\n"
10194 msgstr ""
10195
10196 #. type: Plain text
10197 #: build/C/man3/stdio.3:250
10198 msgid "The I<stdio> library conforms to C89."
10199 msgstr ""
10200
10201 #. type: Plain text
10202 #: build/C/man3/stdio.3:257
10203 msgid ""
10204 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
10205 "B<unlocked_stdio>(3)"
10206 msgstr ""
10207
10208 #. type: TH
10209 #: build/C/man3/stdio_ext.3:25
10210 #, no-wrap
10211 msgid "STDIO_EXT"
10212 msgstr ""
10213
10214 #. type: Plain text
10215 #: build/C/man3/stdio_ext.3:30
10216 msgid ""
10217 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
10218 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
10219 "structure"
10220 msgstr ""
10221
10222 #. type: Plain text
10223 #: build/C/man3/stdio_ext.3:34
10224 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
10225 msgstr ""
10226
10227 #. type: Plain text
10228 #: build/C/man3/stdio_ext.3:36
10229 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
10230 msgstr ""
10231
10232 #. type: Plain text
10233 #: build/C/man3/stdio_ext.3:38
10234 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
10235 msgstr ""
10236
10237 #. type: Plain text
10238 #: build/C/man3/stdio_ext.3:40
10239 msgid "B<int __flbf(FILE *>I<stream>B<);>"
10240 msgstr ""
10241
10242 #. type: Plain text
10243 #: build/C/man3/stdio_ext.3:42
10244 msgid "B<int __freadable(FILE *>I<stream>B<);>"
10245 msgstr ""
10246
10247 #. type: Plain text
10248 #: build/C/man3/stdio_ext.3:44
10249 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
10250 msgstr ""
10251
10252 #. type: Plain text
10253 #: build/C/man3/stdio_ext.3:46
10254 msgid "B<int __freading(FILE *>I<stream>B<);>"
10255 msgstr ""
10256
10257 #. type: Plain text
10258 #: build/C/man3/stdio_ext.3:48
10259 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
10260 msgstr ""
10261
10262 #. type: Plain text
10263 #: build/C/man3/stdio_ext.3:50
10264 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
10265 msgstr ""
10266
10267 #. type: Plain text
10268 #: build/C/man3/stdio_ext.3:52
10269 msgid "B<void _flushlbf(void);>"
10270 msgstr ""
10271
10272 #. type: Plain text
10273 #: build/C/man3/stdio_ext.3:54
10274 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
10275 msgstr ""
10276
10277 #. type: Plain text
10278 #: build/C/man3/stdio_ext.3:59
10279 msgid ""
10280 "Solaris introduced routines to allow portable access to the internals of the "
10281 "I<FILE> structure, and glibc also implemented these."
10282 msgstr ""
10283
10284 #. type: Plain text
10285 #: build/C/man3/stdio_ext.3:64
10286 msgid ""
10287 "The B<__fbufsize>()  function returns the size of the buffer currently used "
10288 "by the given stream."
10289 msgstr ""
10290
10291 #. type: Plain text
10292 #: build/C/man3/stdio_ext.3:71
10293 msgid ""
10294 "The B<__fpending>()  function returns the number of bytes in the output "
10295 "buffer.  For wide-oriented streams the unit is wide characters.  This "
10296 "function is undefined on buffers in reading mode, or opened read-only."
10297 msgstr ""
10298
10299 #. type: Plain text
10300 #: build/C/man3/stdio_ext.3:76
10301 msgid ""
10302 "The B<__flbf>()  function returns a nonzero value if the stream is "
10303 "line-buffered, and zero otherwise."
10304 msgstr ""
10305
10306 #. type: Plain text
10307 #: build/C/man3/stdio_ext.3:81
10308 msgid ""
10309 "The B<__freadable>()  function returns a nonzero value if the stream allows "
10310 "reading, and zero otherwise."
10311 msgstr ""
10312
10313 #. type: Plain text
10314 #: build/C/man3/stdio_ext.3:86
10315 msgid ""
10316 "The B<__fwritable>()  function returns a nonzero value if the stream allows "
10317 "writing, and zero otherwise."
10318 msgstr ""
10319
10320 #. type: Plain text
10321 #: build/C/man3/stdio_ext.3:92
10322 msgid ""
10323 "The B<__freading>()  function returns a nonzero value if the stream is "
10324 "read-only, or if the last operation on the stream was a read operation, and "
10325 "zero otherwise."
10326 msgstr ""
10327
10328 #. type: Plain text
10329 #: build/C/man3/stdio_ext.3:98
10330 msgid ""
10331 "The B<__fwriting>()  function returns a nonzero value if the stream is "
10332 "write-only (or append-only), or if the last operation on the stream was a "
10333 "write operation, and zero otherwise."
10334 msgstr ""
10335
10336 #. type: Plain text
10337 #: build/C/man3/stdio_ext.3:106
10338 msgid ""
10339 "The B<__fsetlocking>()  function can be used to select the desired type of "
10340 "locking on the stream.  It returns the current type.  The I<type> argument "
10341 "can take the following three values:"
10342 msgstr ""
10343
10344 #. type: TP
10345 #: build/C/man3/stdio_ext.3:106
10346 #, no-wrap
10347 msgid "B<FSETLOCKING_INTERNAL>"
10348 msgstr ""
10349
10350 #. type: Plain text
10351 #: build/C/man3/stdio_ext.3:111
10352 msgid ""
10353 "Perform implicit locking around every operation on the given stream (except "
10354 "for the *_unlocked ones).  This is the default."
10355 msgstr ""
10356
10357 #. type: TP
10358 #: build/C/man3/stdio_ext.3:111
10359 #, no-wrap
10360 msgid "B<FSETLOCKING_BYCALLER>"
10361 msgstr ""
10362
10363 #. type: Plain text
10364 #: build/C/man3/stdio_ext.3:118
10365 msgid ""
10366 "The caller will take care of the locking (possibly using B<flockfile>(3)  in "
10367 "case there is more than one thread), and the stdio routines will not do "
10368 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
10369 msgstr ""
10370
10371 #. type: TP
10372 #: build/C/man3/stdio_ext.3:118
10373 #, no-wrap
10374 msgid "B<FSETLOCKING_QUERY>"
10375 msgstr ""
10376
10377 #. type: Plain text
10378 #: build/C/man3/stdio_ext.3:122
10379 msgid "Don't change the type of locking.  (Only return it.)"
10380 msgstr ""
10381
10382 #. type: Plain text
10383 #: build/C/man3/stdio_ext.3:128
10384 msgid ""
10385 "The B<_flushlbf>()  function flushes all line-buffered streams.  (Presumably "
10386 "so that output to a terminal is forced out, say before reading keyboard "
10387 "input.)"
10388 msgstr ""
10389
10390 #. type: Plain text
10391 #: build/C/man3/stdio_ext.3:132
10392 msgid "The B<__fpurge>()  function discards the contents of the stream's buffer."
10393 msgstr ""
10394
10395 #. type: Plain text
10396 #: build/C/man3/stdio_ext.3:141
10397 msgid ""
10398 "The B<__fbufsize>(), B<__fpending>(), B<__fpurge>()  and B<__fsetlocking>()  "
10399 "functions do not lock the stream, so they are not thread-safe."
10400 msgstr ""
10401
10402 #. type: Plain text
10403 #: build/C/man3/stdio_ext.3:151
10404 msgid ""
10405 "The B<__flbf>(), B<__freadable>(), B<__freading>(), B<__fwritable>(), "
10406 "B<__fwriting>()  and B<_flushlbf>()  functions are thread-safe."
10407 msgstr ""
10408
10409 #. type: Plain text
10410 #: build/C/man3/stdio_ext.3:154
10411 msgid "B<flockfile>(3), B<fpurge>(3)"
10412 msgstr ""
10413
10414 #. type: TH
10415 #: build/C/man2/symlink.2:32 build/C/man7/symlink.7:36
10416 #, no-wrap
10417 msgid "SYMLINK"
10418 msgstr ""
10419
10420 #. type: Plain text
10421 #: build/C/man2/symlink.2:35
10422 msgid "symlink - make a new name for a file"
10423 msgstr ""
10424
10425 #. type: Plain text
10426 #: build/C/man2/symlink.2:39
10427 msgid "B<int symlink(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
10428 msgstr ""
10429
10430 #. type: Plain text
10431 #: build/C/man2/symlink.2:47
10432 msgid "B<symlink>():"
10433 msgstr ""
10434
10435 #. type: Plain text
10436 #: build/C/man2/symlink.2:58
10437 msgid ""
10438 "B<symlink>()  creates a symbolic link named I<newpath> which contains the "
10439 "string I<oldpath>."
10440 msgstr ""
10441
10442 #. type: Plain text
10443 #: build/C/man2/symlink.2:62
10444 msgid ""
10445 "Symbolic links are interpreted at run time as if the contents of the link "
10446 "had been substituted into the path being followed to find a file or "
10447 "directory."
10448 msgstr ""
10449
10450 #. type: Plain text
10451 #: build/C/man2/symlink.2:67
10452 msgid ""
10453 "Symbolic links may contain I<..> path components, which (if used at the "
10454 "start of the link) refer to the parent directories of that in which the link "
10455 "resides."
10456 msgstr ""
10457
10458 #. type: Plain text
10459 #: build/C/man2/symlink.2:71
10460 msgid ""
10461 "A symbolic link (also known as a soft link) may point to an existing file or "
10462 "to a nonexistent one; the latter case is known as a dangling link."
10463 msgstr ""
10464
10465 #. type: Plain text
10466 #: build/C/man2/symlink.2:78
10467 msgid ""
10468 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
10469 "when following the link, but is checked when removal or renaming of the link "
10470 "is requested and the link is in a directory with the sticky bit (B<S_ISVTX>)  "
10471 "set."
10472 msgstr ""
10473
10474 #. type: Plain text
10475 #: build/C/man2/symlink.2:99
10476 msgid ""
10477 "Write access to the directory containing I<newpath> is denied, or one of the "
10478 "directories in the path prefix of I<newpath> did not allow search "
10479 "permission.  (See also B<path_resolution>(7).)"
10480 msgstr ""
10481
10482 #. type: Plain text
10483 #: build/C/man2/symlink.2:104
10484 msgid ""
10485 "The user's quota of resources on the file system has been exhausted.  The "
10486 "resources could be inodes or disk blocks, depending on the file system "
10487 "implementation."
10488 msgstr ""
10489
10490 #. type: Plain text
10491 #: build/C/man2/symlink.2:118
10492 msgid "Too many symbolic links were encountered in resolving I<newpath>."
10493 msgstr ""
10494
10495 #. type: Plain text
10496 #: build/C/man2/symlink.2:128
10497 msgid ""
10498 "A directory component in I<newpath> does not exist or is a dangling symbolic "
10499 "link, or I<oldpath> is the empty string."
10500 msgstr ""
10501
10502 #. type: Plain text
10503 #: build/C/man2/symlink.2:140
10504 msgid "A component used as a directory in I<newpath> is not, in fact, a directory."
10505 msgstr ""
10506
10507 #. type: Plain text
10508 #: build/C/man2/symlink.2:145
10509 msgid ""
10510 "The file system containing I<newpath> does not support the creation of "
10511 "symbolic links."
10512 msgstr ""
10513
10514 #. type: Plain text
10515 #: build/C/man2/symlink.2:149
10516 msgid "I<newpath> is on a read-only file system."
10517 msgstr ""
10518
10519 #. type: Plain text
10520 #: build/C/man2/symlink.2:159
10521 msgid "No checking of I<oldpath> is done."
10522 msgstr ""
10523
10524 #. type: Plain text
10525 #: build/C/man2/symlink.2:164
10526 msgid ""
10527 "Deleting the name referred to by a symlink will actually delete the file "
10528 "(unless it also has other hard links).  If this behavior is not desired, use "
10529 "B<link>(2)."
10530 msgstr ""
10531
10532 #. type: Plain text
10533 #: build/C/man2/symlink.2:176
10534 msgid ""
10535 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
10536 "B<rename>(2), B<symlinkat>(2), B<unlink>(2), B<path_resolution>(7), "
10537 "B<symlink>(7)"
10538 msgstr ""
10539
10540 #. type: TH
10541 #: build/C/man7/symlink.7:36
10542 #, no-wrap
10543 msgid "2008-06-18"
10544 msgstr ""
10545
10546 #. type: Plain text
10547 #: build/C/man7/symlink.7:39
10548 msgid "symlink - symbolic link handling"
10549 msgstr ""
10550
10551 #. type: SH
10552 #: build/C/man7/symlink.7:39
10553 #, no-wrap
10554 msgid "SYMBOLIC LINK HANDLING"
10555 msgstr ""
10556
10557 #. type: Plain text
10558 #: build/C/man7/symlink.7:43
10559 msgid ""
10560 "Symbolic links are files that act as pointers to other files.  To understand "
10561 "their behavior, you must first understand how hard links work."
10562 msgstr ""
10563
10564 #. type: Plain text
10565 #: build/C/man7/symlink.7:59
10566 msgid ""
10567 "A hard link to a file is indistinguishable from the original file because it "
10568 "is a reference to the object underlying the original filename.  (To be "
10569 "precise: each of the hard links to a file is a reference to the same "
10570 "I<i-node number>, where an i-node number is an index into the i-node table, "
10571 "which contains metadata about all files on a file system.  See B<stat>(2).)  "
10572 "Changes to a file are independent of the name used to reference the file.  "
10573 "Hard links may not refer to directories (to prevent the possibility of loops "
10574 "within the file system tree, which would confuse many programs)  and may not "
10575 "refer to files on different file systems (because i-node numbers are not "
10576 "unique across file systems)."
10577 msgstr ""
10578
10579 #. type: Plain text
10580 #: build/C/man7/symlink.7:66
10581 msgid ""
10582 "A symbolic link is a special type of file whose contents are a string that "
10583 "is the pathname another file, the file to which the link refers.  In other "
10584 "words, a symbolic link is a pointer to another name, and not to an "
10585 "underlying object.  For this reason, symbolic links may refer to directories "
10586 "and may cross file system boundaries."
10587 msgstr ""
10588
10589 #. type: Plain text
10590 #: build/C/man7/symlink.7:72
10591 msgid ""
10592 "There is no requirement that the pathname referred to by a symbolic link "
10593 "should exist.  A symbolic link that refers to a pathname that does not exist "
10594 "is said to be a I<dangling link>."
10595 msgstr ""
10596
10597 #. type: Plain text
10598 #: build/C/man7/symlink.7:84
10599 msgid ""
10600 "Because a symbolic link and its referenced object coexist in the file system "
10601 "name space, confusion can arise in distinguishing between the link itself "
10602 "and the referenced object.  On historical systems, commands and system calls "
10603 "adopted their own link-following conventions in a somewhat ad-hoc fashion.  "
10604 "Rules for a more uniform approach, as they are implemented on Linux and "
10605 "other systems, are outlined here.  It is important that site-local "
10606 "applications also conform to these rules, so that the user interface can be "
10607 "as consistent as possible."
10608 msgstr ""
10609
10610 #. type: SS
10611 #: build/C/man7/symlink.7:84
10612 #, no-wrap
10613 msgid "Symbolic link ownership, permissions, and timestamps"
10614 msgstr ""
10615
10616 #. type: Plain text
10617 #: build/C/man7/symlink.7:92
10618 msgid ""
10619 "The owner and group of an existing symbolic link can be changed using "
10620 "B<lchown>(2).  The only time that the ownership of a symbolic link matters "
10621 "is when the link is being removed or renamed in a directory that has the "
10622 "sticky bit set (see B<stat>(2))."
10623 msgstr ""
10624
10625 #. type: Plain text
10626 #: build/C/man7/symlink.7:98
10627 msgid ""
10628 "The last access and last modification timestamps of a symbolic link can be "
10629 "changed using B<utimensat>(2)  or B<lutimes>(3)."
10630 msgstr ""
10631
10632 #.  Linux does not currently implement an lchmod(2).
10633 #
10634 #.  The
10635 #.  4.4BSD
10636 #.  system differs from historical
10637 #.  4BSD
10638 #.  systems in that the system call
10639 #.  .BR chown (2)
10640 #.  has been changed to follow symbolic links.
10641 #.  The
10642 #.  .BR lchown (2)
10643 #.  system call was added later when the limitations of the new
10644 #.  .BR chown (2)
10645 #.  became apparent.
10646 #. type: Plain text
10647 #: build/C/man7/symlink.7:117
10648 msgid ""
10649 "On Linux, the permissions of a symbolic link are not used in any operations; "
10650 "the permissions are always 0777 (read, write, and execute for all user "
10651 "categories), and can't be changed."
10652 msgstr ""
10653
10654 #. type: SS
10655 #: build/C/man7/symlink.7:117
10656 #, no-wrap
10657 msgid "Handling of symbolic links by system calls and commands"
10658 msgstr ""
10659
10660 #. type: Plain text
10661 #: build/C/man7/symlink.7:132
10662 msgid ""
10663 "Symbolic links are handled either by operating on the link itself, or by "
10664 "operating on the object referred to by the link.  In the latter case, an "
10665 "application or system call is said to I<follow> the link.  Symbolic links "
10666 "may refer to other symbolic links, in which case the links are dereferenced "
10667 "until an object that is not a symbolic link is found, a symbolic link that "
10668 "refers to a file which does not exist is found, or a loop is detected.  "
10669 "(Loop detection is done by placing an upper limit on the number of links "
10670 "that may be followed, and an error results if this limit is exceeded.)"
10671 msgstr ""
10672
10673 #. type: Plain text
10674 #: build/C/man7/symlink.7:135
10675 msgid ""
10676 "There are three separate areas that need to be discussed.  They are as "
10677 "follows:"
10678 msgstr ""
10679
10680 #. type: IP
10681 #: build/C/man7/symlink.7:135
10682 #, no-wrap
10683 msgid "1."
10684 msgstr ""
10685
10686 #. type: Plain text
10687 #: build/C/man7/symlink.7:137
10688 msgid "Symbolic links used as filename arguments for system calls."
10689 msgstr ""
10690
10691 #. type: IP
10692 #: build/C/man7/symlink.7:137
10693 #, no-wrap
10694 msgid "2."
10695 msgstr ""
10696
10697 #. type: Plain text
10698 #: build/C/man7/symlink.7:140
10699 msgid ""
10700 "Symbolic links specified as command-line arguments to utilities that are not "
10701 "traversing a file tree."
10702 msgstr ""
10703
10704 #. type: IP
10705 #: build/C/man7/symlink.7:140
10706 #, no-wrap
10707 msgid "3."
10708 msgstr ""
10709
10710 #. type: Plain text
10711 #: build/C/man7/symlink.7:144
10712 msgid ""
10713 "Symbolic links encountered by utilities that are traversing a file tree "
10714 "(either specified on the command line or encountered as part of the file "
10715 "hierarchy walk)."
10716 msgstr ""
10717
10718 #. type: SS
10719 #: build/C/man7/symlink.7:144
10720 #, no-wrap
10721 msgid "System calls"
10722 msgstr ""
10723
10724 #. type: Plain text
10725 #: build/C/man7/symlink.7:147
10726 msgid ""
10727 "The first area is symbolic links used as filename arguments for system "
10728 "calls."
10729 msgstr ""
10730
10731 #. type: Plain text
10732 #: build/C/man7/symlink.7:157
10733 msgid ""
10734 "Except as noted below, all system calls follow symbolic links.  For example, "
10735 "if there were a symbolic link I<slink> which pointed to a file named "
10736 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
10737 "descriptor referring to the file I<afile>."
10738 msgstr ""
10739
10740 #.  Maybe one day: .BR fchownat (2)
10741 #. type: Plain text
10742 #: build/C/man7/symlink.7:207
10743 msgid ""
10744 "Various system calls do not follow links, and operate on the symbolic link "
10745 "itself.  They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
10746 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
10747 "B<rename>(2), B<rmdir>(2), and B<unlink>(2).  Certain other system calls "
10748 "optionally follow symbolic links.  They are: B<faccessat>(2), "
10749 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), and "
10750 "B<utimensat>(2); see their manual pages for details.  Because B<remove>(3)  "
10751 "is an alias for B<unlink>(2), that library function also does not follow "
10752 "symbolic links.  When B<rmdir>(2)  is applied to a symbolic link, it fails "
10753 "with the error B<ENOTDIR>.  The B<link>(2)  warrants special discussion.  "
10754 "POSIX.1-2001 specifies that B<link>(2)  should dereference I<oldpath> if it "
10755 "is a symbolic link.  However, Linux does not do this.  (By default Solaris "
10756 "is the same, but the POSIX.1-2001 specified behavior can be obtained with "
10757 "suitable compiler options.)  The upcoming POSIX.1 revision changes the "
10758 "specification to allow either behavior in an implementation."
10759 msgstr ""
10760
10761 #. type: SS
10762 #: build/C/man7/symlink.7:207
10763 #, no-wrap
10764 msgid "Commands not traversing a file tree"
10765 msgstr ""
10766
10767 #. type: Plain text
10768 #: build/C/man7/symlink.7:210
10769 msgid ""
10770 "The second area is symbolic links, specified as command-line filename "
10771 "arguments, to commands which are not traversing a file tree."
10772 msgstr ""
10773
10774 #. type: Plain text
10775 #: build/C/man7/symlink.7:221
10776 msgid ""
10777 "Except as noted below, commands follow symbolic links named as command-line "
10778 "arguments.  For example, if there were a symbolic link I<slink> which "
10779 "pointed to a file named I<afile>, the command I<cat slink> would display the "
10780 "contents of the file I<afile>."
10781 msgstr ""
10782
10783 #. type: Plain text
10784 #: build/C/man7/symlink.7:229
10785 msgid ""
10786 "It is important to realize that this rule includes commands which may "
10787 "optionally traverse file trees, e.g., the command I<chown file> is included "
10788 "in this rule, while the command I<chown\\ -R file>, which performs a tree "
10789 "traversal, is not.  (The latter is described in the third area, below.)"
10790 msgstr ""
10791
10792 #. type: Plain text
10793 #: build/C/man7/symlink.7:247
10794 msgid ""
10795 "If it is explicitly intended that the command operate on the symbolic link "
10796 "instead of following the symbolic link, e.g., it is desired that I<chown "
10797 "slink> change the ownership of the file that I<slink> is, whether it is a "
10798 "symbolic link or not, the I<-h> option should be used.  In the above "
10799 "example, I<chown root slink> would change the ownership of the file referred "
10800 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
10801 "I<slink> itself."
10802 msgstr ""
10803
10804 #. type: Plain text
10805 #: build/C/man7/symlink.7:249
10806 msgid "There are some exceptions to this rule:"
10807 msgstr ""
10808
10809 #. type: Plain text
10810 #: build/C/man7/symlink.7:259
10811 msgid ""
10812 "The B<mv>(1)  and B<rm>(1)  commands do not follow symbolic links named as "
10813 "arguments, but respectively attempt to rename and delete them.  (Note, if "
10814 "the symbolic link references a file via a relative path, moving it to "
10815 "another directory may very well cause it to stop working, since the path may "
10816 "no longer be correct.)"
10817 msgstr ""
10818
10819 #. type: Plain text
10820 #: build/C/man7/symlink.7:289
10821 msgid ""
10822 "The B<ls>(1)  command is also an exception to this rule.  For compatibility "
10823 "with historic systems (when B<ls>(1)  is not doing a tree walk, i.e., the "
10824 "I<-R> option is not specified), the B<ls>(1)  command follows symbolic links "
10825 "named as arguments if the I<-H> or I<-L> option is specified, or if the "
10826 "I<-F>, I<-d>, or I<-l> options are not specified.  (The B<ls>(1)  command is "
10827 "the only command where the I<-H> and I<-L> options affect its behavior even "
10828 "though it is not doing a walk of a file tree.)"
10829 msgstr ""
10830
10831 #
10832 #. The 4.4BSD system differs from historical 4BSD systems in that the
10833 #. .BR chown (1)
10834 #. and
10835 #. .BR chgrp (1)
10836 #. commands follow symbolic links specified on the command line.
10837 #. type: Plain text
10838 #: build/C/man7/symlink.7:307
10839 msgid ""
10840 "The B<file>(1)  command is also an exception to this rule.  The B<file>(1)  "
10841 "command does not follow symbolic links named as argument by default.  The "
10842 "B<file>(1)  command does follow symbolic links named as argument if the "
10843 "I<-L> option is specified."
10844 msgstr ""
10845
10846 #. type: SS
10847 #: build/C/man7/symlink.7:307
10848 #, no-wrap
10849 msgid "Commands traversing a file tree"
10850 msgstr ""
10851
10852 #. type: Plain text
10853 #: build/C/man7/symlink.7:320
10854 msgid ""
10855 "The following commands either optionally or always traverse file trees: "
10856 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
10857 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
10858 msgstr ""
10859
10860 #. type: Plain text
10861 #: build/C/man7/symlink.7:324
10862 msgid ""
10863 "It is important to realize that the following rules apply equally to "
10864 "symbolic links encountered during the file tree traversal and symbolic links "
10865 "listed as command-line arguments."
10866 msgstr ""
10867
10868 #. type: Plain text
10869 #: build/C/man7/symlink.7:329
10870 msgid ""
10871 "The I<first rule> applies to symbolic links that reference files other than "
10872 "directories.  Operations that apply to symbolic links are performed on the "
10873 "links themselves, but otherwise the links are ignored."
10874 msgstr ""
10875
10876 #. type: Plain text
10877 #: build/C/man7/symlink.7:341
10878 msgid ""
10879 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
10880 "symbolic links encountered in the tree traversal of I<directory>, because "
10881 "symbolic links may be removed.  In no case will B<rm>(1)  affect the file "
10882 "referred to by I<slink>."
10883 msgstr ""
10884
10885 #. type: Plain text
10886 #: build/C/man7/symlink.7:346
10887 msgid ""
10888 "The I<second rule> applies to symbolic links that refer to directories.  "
10889 "Symbolic links that refer to directories are never followed by default.  "
10890 "This is often referred to as a \"physical\" walk, as opposed to a "
10891 "\"logical\" walk (where symbolic links the refer to directories are "
10892 "followed)."
10893 msgstr ""
10894
10895 #. type: Plain text
10896 #: build/C/man7/symlink.7:349
10897 msgid ""
10898 "Certain conventions are (should be) followed as consistently as possible by "
10899 "commands that perform file tree walks:"
10900 msgstr ""
10901
10902 #. type: Plain text
10903 #: build/C/man7/symlink.7:362
10904 msgid ""
10905 "A command can be made to follow any symbolic links named on the command "
10906 "line, regardless of the type of file they reference, by specifying the I<-H> "
10907 "(for \"half-logical\") flag.  This flag is intended to make the command-line "
10908 "name space look like the logical name space.  (Note, for commands that do "
10909 "not always do file tree traversals, the I<-H> flag will be ignored if the "
10910 "I<-R> flag is not also specified.)"
10911 msgstr ""
10912
10913 #. type: Plain text
10914 #: build/C/man7/symlink.7:378
10915 msgid ""
10916 "For example, the command I<chown\\ -HR user slink> will traverse the file "
10917 "hierarchy rooted in the file pointed to by I<slink>.  Note, the I<-H> is not "
10918 "the same as the previously discussed I<-h> flag.  The I<-H> flag causes "
10919 "symbolic links specified on the command line to be dereferenced for the "
10920 "purposes of both the action to be performed and the tree walk, and it is as "
10921 "if the user had specified the name of the file to which the symbolic link "
10922 "pointed."
10923 msgstr ""
10924
10925 #. type: Plain text
10926 #: build/C/man7/symlink.7:392
10927 msgid ""
10928 "A command can be made to follow any symbolic links named on the command "
10929 "line, as well as any symbolic links encountered during the traversal, "
10930 "regardless of the type of file they reference, by specifying the I<-L> (for "
10931 "\"logical\") flag.  This flag is intended to make the entire name space look "
10932 "like the logical name space.  (Note, for commands that do not always do file "
10933 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
10934 "also specified.)"
10935 msgstr ""
10936
10937 #. type: Plain text
10938 #: build/C/man7/symlink.7:407
10939 msgid ""
10940 "For example, the command I<chown\\ -LR user slink> will change the owner of "
10941 "the file referred to by I<slink>.  If I<slink> refers to a directory, "
10942 "B<chown> will traverse the file hierarchy rooted in the directory that it "
10943 "references.  In addition, if any symbolic links are encountered in any file "
10944 "tree that B<chown> traverses, they will be treated in the same fashion as "
10945 "I<slink>."
10946 msgstr ""
10947
10948 #. type: Plain text
10949 #: build/C/man7/symlink.7:414
10950 msgid ""
10951 "A command can be made to provide the default behavior by specifying the "
10952 "I<-P> (for \"physical\") flag.  This flag is intended to make the entire "
10953 "name space look like the physical name space."
10954 msgstr ""
10955
10956 #. type: Plain text
10957 #: build/C/man7/symlink.7:432
10958 msgid ""
10959 "For commands that do not by default do file tree traversals, the I<-H>, "
10960 "I<-L>, and I<-P> flags are ignored if the I<-R> flag is not also specified.  "
10961 "In addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
10962 "once; the last one specified determines the command's behavior.  This is "
10963 "intended to permit you to alias commands to behave one way or the other, and "
10964 "then override that behavior on the command line."
10965 msgstr ""
10966
10967 #. type: Plain text
10968 #: build/C/man7/symlink.7:438
10969 msgid "The B<ls>(1)  and B<rm>(1)  commands have exceptions to these rules:"
10970 msgstr ""
10971
10972 #. type: Plain text
10973 #: build/C/man7/symlink.7:451
10974 msgid ""
10975 "The B<rm>(1)  command operates on the symbolic link, and not the file it "
10976 "references, and therefore never follows a symbolic link.  The B<rm>(1)  "
10977 "command does not support the I<-H>, I<-L>, or I<-P> options."
10978 msgstr ""
10979
10980 #. type: Plain text
10981 #: build/C/man7/symlink.7:471
10982 msgid ""
10983 "To maintain compatibility with historic systems, the B<ls>(1)  command acts "
10984 "a little differently.  If you do not specify the I<-F>, I<-d> or I<-l> "
10985 "options, B<ls>(1)  will follow symbolic links specified on the command "
10986 "line.  If the I<-L> flag is specified, B<ls>(1)  follows all symbolic links, "
10987 "regardless of their type, whether specified on the command line or "
10988 "encountered in the tree walk."
10989 msgstr ""
10990
10991 #. type: Plain text
10992 #: build/C/man7/symlink.7:489
10993 msgid ""
10994 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
10995 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
10996 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
10997 "B<path_resolution>(7)"
10998 msgstr ""
10999
11000 #. type: TH
11001 #: build/C/man3/tempnam.3:25
11002 #, no-wrap
11003 msgid "TEMPNAM"
11004 msgstr ""
11005
11006 #. type: Plain text
11007 #: build/C/man3/tempnam.3:28
11008 msgid "tempnam - create a name for a temporary file"
11009 msgstr ""
11010
11011 #. type: Plain text
11012 #: build/C/man3/tempnam.3:33
11013 #, no-wrap
11014 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
11015 msgstr ""
11016
11017 #. type: Plain text
11018 #: build/C/man3/tempnam.3:42
11019 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
11020 msgstr ""
11021
11022 #. type: Plain text
11023 #: build/C/man3/tempnam.3:56
11024 msgid ""
11025 "The B<tempnam>()  function returns a pointer to a string that is a valid "
11026 "filename, and such that a file with this name did not exist when "
11027 "B<tempnam>()  checked.  The filename suffix of the pathname generated will "
11028 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
11029 "bytes.  The directory prefix part of the pathname generated is required to "
11030 "be \"appropriate\" (often that at least implies writable)."
11031 msgstr ""
11032
11033 #. type: Plain text
11034 #: build/C/man3/tempnam.3:59
11035 msgid "Attempts to find an appropriate directory go through the following steps:"
11036 msgstr ""
11037
11038 #. type: TP
11039 #: build/C/man3/tempnam.3:59
11040 #, no-wrap
11041 msgid "a)"
11042 msgstr ""
11043
11044 #. type: Plain text
11045 #: build/C/man3/tempnam.3:65
11046 msgid ""
11047 "In case the environment variable B<TMPDIR> exists and contains the name of "
11048 "an appropriate directory, that is used."
11049 msgstr ""
11050
11051 #. type: TP
11052 #: build/C/man3/tempnam.3:65
11053 #, no-wrap
11054 msgid "b)"
11055 msgstr ""
11056
11057 #. type: Plain text
11058 #: build/C/man3/tempnam.3:70
11059 msgid "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
11060 msgstr ""
11061
11062 #. type: TP
11063 #: build/C/man3/tempnam.3:70
11064 #, no-wrap
11065 msgid "c)"
11066 msgstr ""
11067
11068 #. type: Plain text
11069 #: build/C/man3/tempnam.3:77
11070 msgid ""
11071 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>)  is used when "
11072 "appropriate."
11073 msgstr ""
11074
11075 #. type: TP
11076 #: build/C/man3/tempnam.3:77
11077 #, no-wrap
11078 msgid "d)"
11079 msgstr ""
11080
11081 #. type: Plain text
11082 #: build/C/man3/tempnam.3:80
11083 msgid "Finally an implementation-defined directory may be used."
11084 msgstr ""
11085
11086 #. type: Plain text
11087 #: build/C/man3/tempnam.3:87
11088 msgid ""
11089 "The string returned by B<tempnam>()  is allocated using B<malloc>(3)  and "
11090 "hence should be freed by B<free>(3)."
11091 msgstr ""
11092
11093 #. type: Plain text
11094 #: build/C/man3/tempnam.3:94
11095 msgid ""
11096 "On succes, the B<tempnam>()  function returns a pointer to a unique "
11097 "temporary filename.  It returns NULL if a unique name cannot be generated, "
11098 "with I<errno> set to indicate the cause of the error."
11099 msgstr ""
11100
11101 #. type: Plain text
11102 #: build/C/man3/tempnam.3:98
11103 msgid "Allocation of storage failed."
11104 msgstr ""
11105
11106 #. type: Plain text
11107 #: build/C/man3/tempnam.3:103
11108 msgid "SVr4, 4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<tempnam>()  as obsolete."
11109 msgstr ""
11110
11111 #. type: Plain text
11112 #: build/C/man3/tempnam.3:122
11113 msgid ""
11114 "Although B<tempnam>()  generates names that are difficult to guess, it is "
11115 "nevertheless possible that between the time that B<tempnam>()  returns a "
11116 "pathname, and the time that the program opens it, another program might "
11117 "create that pathname using B<open>(2), or create it as a symbolic link.  "
11118 "This can lead to security holes.  To avoid such possibilities, use the "
11119 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
11120 "B<mkstemp>(3)  or B<tmpfile>(3)."
11121 msgstr ""
11122
11123 #. type: Plain text
11124 #: build/C/man3/tempnam.3:130
11125 msgid ""
11126 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
11127 "program is not set-user-ID.  On SVr4, the directory used under B<d)> is "
11128 "I</tmp> (and this is what glibc does)."
11129 msgstr ""
11130
11131 #. type: Plain text
11132 #: build/C/man3/tempnam.3:135
11133 msgid ""
11134 "Because it dynamically allocates memory used to return the pathname, "
11135 "B<tempnam>()  is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
11136 msgstr ""
11137
11138 #. type: Plain text
11139 #: build/C/man3/tempnam.3:148
11140 msgid ""
11141 "The B<tempnam>()  function generates a different string each time it is "
11142 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>)  times.  If it is "
11143 "called more than B<TMP_MAX> times, the behavior is implementation defined."
11144 msgstr ""
11145
11146 #. type: Plain text
11147 #: build/C/man3/tempnam.3:152
11148 msgid "B<tempnam>()  uses at most the first five bytes from I<pfx>."
11149 msgstr ""
11150
11151 #. type: Plain text
11152 #: build/C/man3/tempnam.3:158
11153 msgid ""
11154 "The glibc implementation of B<tempnam>()  will fail with the error B<EEXIST> "
11155 "upon failure to find a unique name."
11156 msgstr ""
11157
11158 #. type: Plain text
11159 #: build/C/man3/tempnam.3:161
11160 msgid ""
11161 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
11162 "accessibility of a directory is determined."
11163 msgstr ""
11164
11165 #. type: Plain text
11166 #: build/C/man3/tempnam.3:168 build/C/man3/tmpnam.3:163
11167 msgid "Never use this function.  Use B<mkstemp>(3)  or B<tmpfile>(3)  instead."
11168 msgstr ""
11169
11170 #. type: Plain text
11171 #: build/C/man3/tempnam.3:173
11172 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
11173 msgstr ""
11174
11175 #. type: TH
11176 #: build/C/man3/tmpfile.3:31
11177 #, no-wrap
11178 msgid "TMPFILE"
11179 msgstr ""
11180
11181 #. type: Plain text
11182 #: build/C/man3/tmpfile.3:34
11183 msgid "tmpfile - create a temporary file"
11184 msgstr ""
11185
11186 #. type: Plain text
11187 #: build/C/man3/tmpfile.3:39
11188 #, no-wrap
11189 msgid "B<FILE *tmpfile(void);>\n"
11190 msgstr ""
11191
11192 #. type: Plain text
11193 #: build/C/man3/tmpfile.3:47
11194 msgid ""
11195 "The B<tmpfile>()  function opens a unique temporary file in binary "
11196 "read/write (w+b) mode.  The file will be automatically deleted when it is "
11197 "closed or the program terminates."
11198 msgstr ""
11199
11200 #. type: Plain text
11201 #: build/C/man3/tmpfile.3:56
11202 msgid ""
11203 "The B<tmpfile>()  function returns a stream descriptor, or NULL if a unique "
11204 "filename cannot be generated or the unique file cannot be opened.  In the "
11205 "latter case, I<errno> is set to indicate the error."
11206 msgstr ""
11207
11208 #. type: Plain text
11209 #: build/C/man3/tmpfile.3:60
11210 msgid "Search permission denied for directory in file's path prefix."
11211 msgstr ""
11212
11213 #. type: Plain text
11214 #: build/C/man3/tmpfile.3:63
11215 msgid "Unable to generate a unique filename."
11216 msgstr ""
11217
11218 #. type: Plain text
11219 #: build/C/man3/tmpfile.3:66
11220 msgid "The call was interrupted by a signal."
11221 msgstr ""
11222
11223 #. type: Plain text
11224 #: build/C/man3/tmpfile.3:69
11225 msgid "Too many file descriptors in use by the process."
11226 msgstr ""
11227
11228 #. type: Plain text
11229 #: build/C/man3/tmpfile.3:72
11230 msgid "Too many files open in the system."
11231 msgstr ""
11232
11233 #. type: Plain text
11234 #: build/C/man3/tmpfile.3:75
11235 msgid "There was no room in the directory to add the new filename."
11236 msgstr ""
11237
11238 #. type: Plain text
11239 #: build/C/man3/tmpfile.3:78
11240 msgid "Read-only file system."
11241 msgstr ""
11242
11243 #. type: Plain text
11244 #: build/C/man3/tmpfile.3:80
11245 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
11246 msgstr ""
11247
11248 #. type: Plain text
11249 #: build/C/man3/tmpfile.3:86
11250 msgid ""
11251 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
11252 "stream cannot be opened."
11253 msgstr ""
11254
11255 #. type: Plain text
11256 #: build/C/man3/tmpfile.3:97
11257 msgid ""
11258 "The standard does not specify the directory that B<tmpfile>()  will use.  "
11259 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
11260 "and if that fails the directory I</tmp>."
11261 msgstr ""
11262
11263 #. type: Plain text
11264 #: build/C/man3/tmpfile.3:103
11265 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
11266 msgstr ""
11267
11268 #. type: TH
11269 #: build/C/man3/tmpnam.3:27
11270 #, no-wrap
11271 msgid "TMPNAM"
11272 msgstr ""
11273
11274 #. type: Plain text
11275 #: build/C/man3/tmpnam.3:30
11276 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
11277 msgstr ""
11278
11279 #. type: Plain text
11280 #: build/C/man3/tmpnam.3:35
11281 #, no-wrap
11282 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
11283 msgstr ""
11284
11285 #. type: Plain text
11286 #: build/C/man3/tmpnam.3:58
11287 msgid ""
11288 "The B<tmpnam>()  function returns a pointer to a string that is a valid "
11289 "filename, and such that a file with this name did not exist at some point in "
11290 "time, so that naive programmers may think it a suitable name for a temporary "
11291 "file.  If the argument I<s> is NULL this name is generated in an internal "
11292 "static buffer and may be overwritten by the next call to B<tmpnam>().  If "
11293 "I<s> is not NULL, the name is copied to the character array (of length at "
11294 "least I<L_tmpnam>)  pointed to by I<s> and the value I<s> is returned in "
11295 "case of success."
11296 msgstr ""
11297
11298 #. type: Plain text
11299 #: build/C/man3/tmpnam.3:70
11300 msgid ""
11301 "The pathname that is created, has a directory prefix I<P_tmpdir>.  (Both "
11302 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
11303 "the B<TMP_MAX> mentioned below.)"
11304 msgstr ""
11305
11306 #. type: Plain text
11307 #: build/C/man3/tmpnam.3:75
11308 msgid ""
11309 "The B<tmpnam>()  function returns a pointer to a unique temporary filename, "
11310 "or NULL if a unique name cannot be generated."
11311 msgstr ""
11312
11313 #. type: Plain text
11314 #: build/C/man3/tmpnam.3:77
11315 msgid "No errors are defined."
11316 msgstr ""
11317
11318 #. type: Plain text
11319 #: build/C/man3/tmpnam.3:83
11320 msgid ""
11321 "The B<tmpnam>()  function is thread-safe with exceptions.  It is not "
11322 "thread-safe if called with a NULL parameter."
11323 msgstr ""
11324
11325 #. type: Plain text
11326 #: build/C/man3/tmpnam.3:87
11327 msgid "The B<tmpnam_r>()  function is thread-safe."
11328 msgstr ""
11329
11330 #. type: Plain text
11331 #: build/C/man3/tmpnam.3:92
11332 msgid ""
11333 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001.  POSIX.1-2008 marks B<tmpnam>()  as "
11334 "obsolete."
11335 msgstr ""
11336
11337 #. type: Plain text
11338 #: build/C/man3/tmpnam.3:103
11339 msgid ""
11340 "The B<tmpnam>()  function generates a different string each time it is "
11341 "called, up to B<TMP_MAX> times.  If it is called more than B<TMP_MAX> times, "
11342 "the behavior is implementation defined."
11343 msgstr ""
11344
11345 #. type: Plain text
11346 #: build/C/man3/tmpnam.3:122
11347 msgid ""
11348 "Although B<tmpnam>()  generates names that are difficult to guess, it is "
11349 "nevertheless possible that between the time that B<tmpnam>()  returns a "
11350 "pathname, and the time that the program opens it, another program might "
11351 "create that pathname using B<open>(2), or create it as a symbolic link.  "
11352 "This can lead to security holes.  To avoid such possibilities, use the "
11353 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
11354 "B<mkstemp>(3)  or B<tmpfile>(3)."
11355 msgstr ""
11356
11357 #. type: Plain text
11358 #: build/C/man3/tmpnam.3:130
11359 msgid ""
11360 "Portable applications that use threads cannot call B<tmpnam>()  with a NULL "
11361 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
11362 "defined."
11363 msgstr ""
11364
11365 #. type: Plain text
11366 #: build/C/man3/tmpnam.3:134
11367 msgid "A POSIX draft proposed to use a function B<tmpnam_r>()  defined by"
11368 msgstr ""
11369
11370 #. type: Plain text
11371 #: build/C/man3/tmpnam.3:142
11372 #, no-wrap
11373 msgid ""
11374 "char *\n"
11375 "tmpnam_r(char *s)\n"
11376 "{\n"
11377 "    return s ? tmpnam(s) : NULL;\n"
11378 "}\n"
11379 msgstr ""
11380
11381 #. type: Plain text
11382 #: build/C/man3/tmpnam.3:156
11383 msgid ""
11384 "apparently as a warning not to use NULL.  A few systems implement it.  To "
11385 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
11386 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
11387 msgstr ""
11388
11389 #. type: Plain text
11390 #: build/C/man3/tmpnam.3:168
11391 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
11392 msgstr ""
11393
11394 #. type: TH
11395 #: build/C/man2/unlink.2:32
11396 #, no-wrap
11397 msgid "UNLINK"
11398 msgstr ""
11399
11400 #. type: TH
11401 #: build/C/man2/unlink.2:32
11402 #, no-wrap
11403 msgid "2011-09-15"
11404 msgstr ""
11405
11406 #. type: Plain text
11407 #: build/C/man2/unlink.2:35
11408 msgid "unlink - delete a name and possibly the file it refers to"
11409 msgstr ""
11410
11411 #. type: Plain text
11412 #: build/C/man2/unlink.2:39
11413 msgid "B<int unlink(const char *>I<pathname>B<);>"
11414 msgstr ""
11415
11416 #. type: Plain text
11417 #: build/C/man2/unlink.2:45
11418 msgid ""
11419 "B<unlink>()  deletes a name from the file system.  If that name was the last "
11420 "link to a file and no processes have the file open the file is deleted and "
11421 "the space it was using is made available for reuse."
11422 msgstr ""
11423
11424 #. type: Plain text
11425 #: build/C/man2/unlink.2:49
11426 msgid ""
11427 "If the name was the last link to a file but any processes still have the "
11428 "file open the file will remain in existence until the last file descriptor "
11429 "referring to it is closed."
11430 msgstr ""
11431
11432 #. type: Plain text
11433 #: build/C/man2/unlink.2:51
11434 msgid "If the name referred to a symbolic link the link is removed."
11435 msgstr ""
11436
11437 #. type: Plain text
11438 #: build/C/man2/unlink.2:55
11439 msgid ""
11440 "If the name referred to a socket, fifo or device the name for it is removed "
11441 "but processes which have the object open may continue to use it."
11442 msgstr ""
11443
11444 #. type: Plain text
11445 #: build/C/man2/unlink.2:71
11446 msgid ""
11447 "Write access to the directory containing I<pathname> is not allowed for the "
11448 "process's effective UID, or one of the directories in I<pathname> did not "
11449 "allow search permission.  (See also B<path_resolution>(7).)"
11450 msgstr ""
11451
11452 #. type: Plain text
11453 #: build/C/man2/unlink.2:80
11454 msgid ""
11455 "The file I<pathname> cannot be unlinked because it is being used by the "
11456 "system or another process; for example, it is a mount point or the NFS "
11457 "client software created it to represent an active but otherwise nameless "
11458 "inode (\"NFS silly renamed\")."
11459 msgstr ""
11460
11461 #. type: Plain text
11462 #: build/C/man2/unlink.2:92
11463 msgid ""
11464 "I<pathname> refers to a directory.  (This is the non-POSIX value returned by "
11465 "Linux since 2.1.132.)"
11466 msgstr ""
11467
11468 #. type: Plain text
11469 #: build/C/man2/unlink.2:96
11470 msgid "Too many symbolic links were encountered in translating I<pathname>."
11471 msgstr ""
11472
11473 #. type: Plain text
11474 #: build/C/man2/unlink.2:106
11475 msgid ""
11476 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
11477 "I<pathname> is empty."
11478 msgstr ""
11479
11480 #. type: Plain text
11481 #: build/C/man2/unlink.2:114
11482 msgid "A component used as a directory in I<pathname> is not, in fact, a directory."
11483 msgstr ""
11484
11485 #. type: Plain text
11486 #: build/C/man2/unlink.2:123
11487 msgid ""
11488 "The system does not allow unlinking of directories, or unlinking of "
11489 "directories requires privileges that the calling process doesn't have.  "
11490 "(This is the POSIX prescribed error return; as noted above, Linux returns "
11491 "B<EISDIR> for this case.)"
11492 msgstr ""
11493
11494 #. type: TP
11495 #: build/C/man2/unlink.2:123
11496 #, no-wrap
11497 msgid "B<EPERM> (Linux only)"
11498 msgstr ""
11499
11500 #. type: Plain text
11501 #: build/C/man2/unlink.2:126
11502 msgid "The file system does not allow unlinking of files."
11503 msgstr ""
11504
11505 #. type: Plain text
11506 #: build/C/man2/unlink.2:137
11507 msgid ""
11508 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
11509 "and the process's effective UID is neither the UID of the file to be deleted "
11510 "nor that of the directory containing it, and the process is not privileged "
11511 "(Linux: does not have the B<CAP_FOWNER> capability)."
11512 msgstr ""
11513
11514 #. type: Plain text
11515 #: build/C/man2/unlink.2:141
11516 msgid "I<pathname> refers to a file on a read-only file system."
11517 msgstr ""
11518
11519 #. type: Plain text
11520 #: build/C/man2/unlink.2:161
11521 msgid ""
11522 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
11523 "B<rmdir>(2), B<unlinkat>(2), B<mkfifo>(3), B<remove>(3), "
11524 "B<path_resolution>(7), B<symlink>(7)"
11525 msgstr ""
11526
11527 #. type: TH
11528 #: build/C/man3/unlocked_stdio.3:25
11529 #, no-wrap
11530 msgid "UNLOCKED_STDIO"
11531 msgstr ""
11532
11533 #. type: TH
11534 #: build/C/man3/unlocked_stdio.3:25
11535 #, no-wrap
11536 msgid "2008-08-29"
11537 msgstr ""
11538
11539 #. type: Plain text
11540 #: build/C/man3/unlocked_stdio.3:29
11541 msgid ""
11542 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
11543 "nonlocking stdio functions"
11544 msgstr ""
11545
11546 #. type: Plain text
11547 #: build/C/man3/unlocked_stdio.3:37
11548 #, no-wrap
11549 msgid ""
11550 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
11551 "B<int getchar_unlocked(void);>\n"
11552 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11553 "B<int putchar_unlocked(int >I<c>B<);>\n"
11554 msgstr ""
11555
11556 #. type: Plain text
11557 #: build/C/man3/unlocked_stdio.3:49
11558 #, no-wrap
11559 msgid ""
11560 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
11561 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
11562 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
11563 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
11564 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
11565 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
11566 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11567 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t "
11568 ">I<n>B<,>\n"
11569 "B<                      FILE *>I<stream>B<);>\n"
11570 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
11571 ">I<n>B<,>\n"
11572 "B<                      FILE *>I<stream>B<);>\n"
11573 msgstr ""
11574
11575 #. type: Plain text
11576 #: build/C/man3/unlocked_stdio.3:52
11577 #, no-wrap
11578 msgid ""
11579 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
11580 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11581 msgstr ""
11582
11583 #. type: Plain text
11584 #: build/C/man3/unlocked_stdio.3:63
11585 #, no-wrap
11586 msgid ""
11587 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
11588 "B<wint_t getwchar_unlocked(void);>\n"
11589 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
11590 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11591 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11592 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
11593 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE "
11594 "*>I<stream>B<);>\n"
11595 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
11596 msgstr ""
11597
11598 #. type: Plain text
11599 #: build/C/man3/unlocked_stdio.3:75
11600 msgid ""
11601 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
11602 "B<putchar_unlocked>():"
11603 msgstr ""
11604
11605 #. type: Plain text
11606 #: build/C/man3/unlocked_stdio.3:78
11607 msgid ""
11608 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
11609 "_BSD_SOURCE || _SVID_SOURCE"
11610 msgstr ""
11611
11612 #. type: Plain text
11613 #: build/C/man3/unlocked_stdio.3:89
11614 msgid ""
11615 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
11616 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
11617 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
11618 msgstr ""
11619
11620 #. type: Plain text
11621 #: build/C/man3/unlocked_stdio.3:91
11622 msgid "_BSD_SOURCE || _SVID_SOURCE"
11623 msgstr ""
11624
11625 #. type: Plain text
11626 #: build/C/man3/unlocked_stdio.3:102
11627 msgid ""
11628 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
11629 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
11630 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
11631 msgstr ""
11632
11633 #. type: Plain text
11634 #: build/C/man3/unlocked_stdio.3:113
11635 msgid ""
11636 "Each of these functions has the same behavior as its counterpart without the "
11637 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
11638 "locks themselves, and do not test for the presence of locks set by others) "
11639 "and hence are thread-unsafe.  See B<flockfile>(3)."
11640 msgstr ""
11641
11642 #. type: Plain text
11643 #: build/C/man3/unlocked_stdio.3:120
11644 msgid ""
11645 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
11646 "B<putc_unlocked>(), B<putchar_unlocked>()  are in POSIX.1-2001."
11647 msgstr ""
11648
11649 #.  E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
11650 #.  moved to a compatibility library.
11651 #.  Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
11652 #.  feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
11653 #.  fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
11654 #.  fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
11655 #.  ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
11656 #.  getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
11657 #.  putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
11658 #.  putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
11659 #.  ungetc_unlocked, ungetwc_unlocked.
11660 #. type: Plain text
11661 #: build/C/man3/unlocked_stdio.3:136
11662 msgid ""
11663 "The nonstandard B<*_unlocked>()  variants occur on a few UNIX systems, and "
11664 "are available in recent glibc.  They should probably not be used."
11665 msgstr ""
11666
11667 #. type: Plain text
11668 #: build/C/man3/unlocked_stdio.3:139
11669 msgid "B<flockfile>(3), B<stdio>(3)"
11670 msgstr ""
11671
11672 #. type: TH
11673 #: build/C/man3/wprintf.3:16
11674 #, no-wrap
11675 msgid "WPRINTF"
11676 msgstr ""
11677
11678 #. type: TH
11679 #: build/C/man3/wprintf.3:16
11680 #, no-wrap
11681 msgid "2011-09-17"
11682 msgstr ""
11683
11684 #. type: Plain text
11685 #: build/C/man3/wprintf.3:20
11686 msgid ""
11687 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted "
11688 "wide-character output conversion"
11689 msgstr ""
11690
11691 #. type: Plain text
11692 #: build/C/man3/wprintf.3:24
11693 #, no-wrap
11694 msgid ""
11695 "B<#include E<lt>stdio.hE<gt>>\n"
11696 "B<#include E<lt>wchar.hE<gt>>\n"
11697 msgstr ""
11698
11699 #. type: Plain text
11700 #: build/C/man3/wprintf.3:29
11701 #, no-wrap
11702 msgid ""
11703 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
11704 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
11705 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11706 "B<             const wchar_t *>I<format>B<, ...);>\n"
11707 msgstr ""
11708
11709 #. type: Plain text
11710 #: build/C/man3/wprintf.3:34
11711 #, no-wrap
11712 msgid ""
11713 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11714 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list "
11715 ">I<args>B<);>\n"
11716 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11717 "B<              const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11718 msgstr ""
11719
11720 #.  .BR wprintf (),
11721 #.  .BR fwprintf (),
11722 #.  .BR swprintf (),
11723 #.  .BR vwprintf (),
11724 #.  .BR vfwprintf (),
11725 #.  .BR vswprintf ():
11726 #. type: Plain text
11727 #: build/C/man3/wprintf.3:51
11728 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
11729 msgstr ""
11730
11731 #. type: Plain text
11732 #: build/C/man3/wprintf.3:53
11733 msgid "_ISOC95_SOURCE /* Since glibc 2.12 */ ||"
11734 msgstr ""
11735
11736 #. type: Plain text
11737 #: build/C/man3/wprintf.3:55
11738 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
11739 msgstr ""
11740
11741 #. type: Plain text
11742 #: build/C/man3/wprintf.3:58
11743 msgid "or I<cc\\ -std=c99>"
11744 msgstr ""
11745
11746 #. type: Plain text
11747 #: build/C/man3/wprintf.3:69
11748 msgid ""
11749 "The B<wprintf>()  family of functions is the wide-character equivalent of "
11750 "the B<printf>(3)  family of functions.  It performs formatted output of wide "
11751 "characters."
11752 msgstr ""
11753
11754 #. type: Plain text
11755 #: build/C/man3/wprintf.3:81
11756 msgid ""
11757 "The B<wprintf>()  and B<vwprintf>()  functions perform wide-character output "
11758 "to I<stdout>.  I<stdout> must not be byte oriented; see B<fwide>(3)  for "
11759 "more information."
11760 msgstr ""
11761
11762 #. type: Plain text
11763 #: build/C/man3/wprintf.3:93
11764 msgid ""
11765 "The B<fwprintf>()  and B<vfwprintf>()  functions perform wide-character "
11766 "output to I<stream>.  I<stream> must not be byte oriented; see B<fwide>(3)  "
11767 "for more information."
11768 msgstr ""
11769
11770 #. type: Plain text
11771 #: build/C/man3/wprintf.3:107
11772 msgid ""
11773 "The B<swprintf>()  and B<vswprintf>()  functions perform wide-character "
11774 "output to an array of wide characters.  The programmer must ensure that "
11775 "there is room for at least I<maxlen> wide characters at I<wcs>."
11776 msgstr ""
11777
11778 #. type: Plain text
11779 #: build/C/man3/wprintf.3:118
11780 msgid ""
11781 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
11782 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3)  functions except for the "
11783 "following differences:"
11784 msgstr ""
11785
11786 #. type: TP
11787 #: build/C/man3/wprintf.3:118 build/C/man3/wprintf.3:123 build/C/man3/wprintf.3:126
11788 #, no-wrap
11789 msgid "B<\\(bu>"
11790 msgstr ""
11791
11792 #. type: Plain text
11793 #: build/C/man3/wprintf.3:123
11794 msgid "The I<format> string is a wide-character string."
11795 msgstr ""
11796
11797 #. type: Plain text
11798 #: build/C/man3/wprintf.3:126
11799 msgid "The output consists of wide characters, not bytes."
11800 msgstr ""
11801
11802 #. type: Plain text
11803 #: build/C/man3/wprintf.3:145
11804 msgid ""
11805 "B<swprintf>()  and B<vswprintf>()  take a I<maxlen> argument, B<sprintf>(3)  "
11806 "and B<vsprintf>(3)  do not.  (B<snprintf>(3)  and B<vsnprintf>(3)  take a "
11807 "I<maxlen> argument, but these functions do not return -1 upon buffer "
11808 "overflow on Linux.)"
11809 msgstr ""
11810
11811 #. type: Plain text
11812 #: build/C/man3/wprintf.3:151
11813 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
11814 msgstr ""
11815
11816 #. type: Plain text
11817 #: build/C/man3/wprintf.3:165
11818 msgid ""
11819 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
11820 "character by a call to the B<btowc>(3)  function, and the resulting wide "
11821 "character is written.  If an B<l> modifier is present, the I<wint_t> (wide "
11822 "character) argument is written."
11823 msgstr ""
11824
11825 #. type: Plain text
11826 #: build/C/man3/wprintf.3:205
11827 msgid ""
11828 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
11829 "to be a pointer to an array of character type (pointer to a string) "
11830 "containing a multibyte character sequence beginning in the initial shift "
11831 "state.  Characters from the array are converted to wide characters (each by "
11832 "a call to the B<mbrtowc>(3)  function with a conversion state starting in "
11833 "the initial state before the first byte).  The resulting wide characters are "
11834 "written up to (but not including) the terminating null wide character "
11835 "(L\\(aq\\e0\\(aq).  If a precision is specified, no more wide characters "
11836 "than the number specified are written.  Note that the precision determines "
11837 "the number of I<wide characters> written, not the number of I<bytes> or "
11838 "I<screen positions>.  The array must contain a terminating null byte "
11839 "(\\(aq\\e0\\(aq), unless a precision is given and it is so small that the "
11840 "number of converted wide characters reaches it before the end of the array "
11841 "is reached.  If an B<l> modifier is present: The I<const\\ wchar_t\\ *> "
11842 "argument is expected to be a pointer to an array of wide characters.  Wide "
11843 "characters from the array are written up to (but not including) a "
11844 "terminating null wide character.  If a precision is specified, no more than "
11845 "the number specified are written.  The array must contain a terminating null "
11846 "wide character, unless a precision is given and it is smaller than or equal "
11847 "to the number of wide characters in the array."
11848 msgstr ""
11849
11850 #. type: Plain text
11851 #: build/C/man3/wprintf.3:213
11852 msgid ""
11853 "The functions return the number of wide characters written, excluding the "
11854 "terminating null wide character in case of the functions B<swprintf>()  and "
11855 "B<vswprintf>().  They return -1 when an error occurs."
11856 msgstr ""
11857
11858 #. type: Plain text
11859 #: build/C/man3/wprintf.3:215
11860 msgid "C99."
11861 msgstr ""
11862
11863 #. type: Plain text
11864 #: build/C/man3/wprintf.3:223
11865 msgid ""
11866 "The behavior of B<wprintf>()  et al. depends on the B<LC_CTYPE> category of "
11867 "the current locale."
11868 msgstr ""
11869
11870 #. type: Plain text
11871 #: build/C/man3/wprintf.3:253
11872 msgid ""
11873 "If the I<format> string contains non-ASCII wide characters, the program will "
11874 "work correctly only if the B<LC_CTYPE> category of the current locale at run "
11875 "time is the same as the B<LC_CTYPE> category of the current locale at "
11876 "compile time.  This is because the I<wchar_t> representation is platform- "
11877 "and locale-dependent.  (The glibc represents wide characters using their "
11878 "Unicode (ISO-10646) code point, but other platforms don't do this.  Also, "
11879 "the use of C99 universal character names of the form \\eunnnn does not solve "
11880 "this problem.)  Therefore, in internationalized programs, the I<format> "
11881 "string should consist of ASCII wide characters only, or should be "
11882 "constructed at run time in an internationalized way (e.g., using "
11883 "B<gettext>(3)  or B<iconv>(3), followed by B<mbstowcs>(3))."
11884 msgstr ""
11885
11886 #.  .BR wscanf (3)
11887 #. type: Plain text
11888 #: build/C/man3/wprintf.3:260
11889 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
11890 msgstr ""
11891
11892 #. type: TH
11893 #: build/C/man2/write.2:39
11894 #, no-wrap
11895 msgid "WRITE"
11896 msgstr ""
11897
11898 #. type: Plain text
11899 #: build/C/man2/write.2:42
11900 msgid "write - write to a file descriptor"
11901 msgstr ""
11902
11903 #. type: Plain text
11904 #: build/C/man2/write.2:46
11905 msgid "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
11906 msgstr ""
11907
11908 #. type: Plain text
11909 #: build/C/man2/write.2:54
11910 msgid ""
11911 "B<write>()  writes up to I<count> bytes from the buffer pointed I<buf> to "
11912 "the file referred to by the file descriptor I<fd>."
11913 msgstr ""
11914
11915 #. type: Plain text
11916 #: build/C/man2/write.2:68
11917 msgid ""
11918 "The number of bytes written may be less than I<count> if, for example, there "
11919 "is insufficient space on the underlying physical medium, or the "
11920 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
11921 "call was interrupted by a signal handler after having written less than "
11922 "I<count> bytes.  (See also B<pipe>(7).)"
11923 msgstr ""
11924
11925 #. type: Plain text
11926 #: build/C/man2/write.2:82
11927 msgid ""
11928 "For a seekable file (i.e., one to which B<lseek>(2)  may be applied, for "
11929 "example, a regular file)  writing takes place at the current file offset, "
11930 "and the file offset is incremented by the number of bytes actually written.  "
11931 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
11932 "to the end of the file before writing.  The adjustment of the file offset "
11933 "and the write operation are performed as an atomic step."
11934 msgstr ""
11935
11936 #. type: Plain text
11937 #: build/C/man2/write.2:89
11938 msgid ""
11939 "POSIX requires that a B<read>(2)  which can be proved to occur after a "
11940 "B<write>()  has returned returns the new data.  Note that not all file "
11941 "systems are POSIX conforming."
11942 msgstr ""
11943
11944 #. type: Plain text
11945 #: build/C/man2/write.2:94
11946 msgid ""
11947 "On success, the number of bytes written is returned (zero indicates nothing "
11948 "was written).  On error, -1 is returned, and I<errno> is set appropriately."
11949 msgstr ""
11950
11951 #. type: Plain text
11952 #: build/C/man2/write.2:107
11953 msgid ""
11954 "If I<count> is zero and I<fd> refers to a regular file, then B<write>()  may "
11955 "return a failure status if one of the errors below is detected.  If no "
11956 "errors are detected, 0 will be returned without causing any other effect.  "
11957 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
11958 "the results are not specified."
11959 msgstr ""
11960
11961 #. type: Plain text
11962 #: build/C/man2/write.2:115
11963 msgid ""
11964 "The file descriptor I<fd> refers to a file other than a socket and has been "
11965 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
11966 msgstr ""
11967
11968 #.  Actually EAGAIN on Linux
11969 #. type: Plain text
11970 #: build/C/man2/write.2:126
11971 msgid ""
11972 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11973 "(B<O_NONBLOCK>), and the write would block.  POSIX.1-2001 allows either "
11974 "error to be returned for this case, and does not require these constants to "
11975 "have the same value, so a portable application should check for both "
11976 "possibilities."
11977 msgstr ""
11978
11979 #. type: Plain text
11980 #: build/C/man2/write.2:130
11981 msgid "I<fd> is not a valid file descriptor or is not open for writing."
11982 msgstr ""
11983
11984 #. type: TP
11985 #: build/C/man2/write.2:130
11986 #, no-wrap
11987 msgid "B<EDESTADDRREQ>"
11988 msgstr ""
11989
11990 #. type: Plain text
11991 #: build/C/man2/write.2:135
11992 msgid ""
11993 "I<fd> refers to a datagram socket for which a peer address has not been set "
11994 "using B<connect>(2)."
11995 msgstr ""
11996
11997 #. type: Plain text
11998 #: build/C/man2/write.2:141
11999 msgid ""
12000 "The user's quota of disk blocks on the file system containing the file "
12001 "referred to by I<fd> has been exhausted."
12002 msgstr ""
12003
12004 #. type: Plain text
12005 #: build/C/man2/write.2:150
12006 msgid ""
12007 "An attempt was made to write a file that exceeds the implementation-defined "
12008 "maximum file size or the process's file size limit, or to write at a "
12009 "position past the maximum allowed offset."
12010 msgstr ""
12011
12012 #. type: Plain text
12013 #: build/C/man2/write.2:154
12014 msgid ""
12015 "The call was interrupted by a signal before any data was written; see "
12016 "B<signal>(7)."
12017 msgstr ""
12018
12019 #. type: Plain text
12020 #: build/C/man2/write.2:165
12021 msgid ""
12022 "I<fd> is attached to an object which is unsuitable for writing; or the file "
12023 "was opened with the B<O_DIRECT> flag, and either the address specified in "
12024 "I<buf>, the value specified in I<count>, or the current file offset is not "
12025 "suitably aligned."
12026 msgstr ""
12027
12028 #. type: Plain text
12029 #: build/C/man2/write.2:168
12030 msgid "A low-level I/O error occurred while modifying the inode."
12031 msgstr ""
12032
12033 #. type: Plain text
12034 #: build/C/man2/write.2:173
12035 msgid ""
12036 "The device containing the file referred to by I<fd> has no room for the "
12037 "data."
12038 msgstr ""
12039
12040 #. type: TP
12041 #: build/C/man2/write.2:173
12042 #, no-wrap
12043 msgid "B<EPIPE>"
12044 msgstr ""
12045
12046 #. type: Plain text
12047 #: build/C/man2/write.2:182
12048 msgid ""
12049 "I<fd> is connected to a pipe or socket whose reading end is closed.  When "
12050 "this happens the writing process will also receive a B<SIGPIPE> signal.  "
12051 "(Thus, the write return value is seen only if the program catches, blocks or "
12052 "ignores this signal.)"
12053 msgstr ""
12054
12055 #. type: Plain text
12056 #: build/C/man2/write.2:185
12057 msgid "Other errors may occur, depending on the object connected to I<fd>."
12058 msgstr ""
12059
12060 #. type: Plain text
12061 #: build/C/man2/write.2:194
12062 msgid ""
12063 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
12064 "just before any data is written."
12065 msgstr ""
12066
12067 #. type: Plain text
12068 #: build/C/man2/write.2:203
12069 msgid ""
12070 "A successful return from B<write>()  does not make any guarantee that data "
12071 "has been committed to disk.  In fact, on some buggy implementations, it does "
12072 "not even guarantee that space has successfully been reserved for the data.  "
12073 "The only way to be sure is to call B<fsync>(2)  after you are done writing "
12074 "all your data."
12075 msgstr ""
12076
12077 #. type: Plain text
12078 #: build/C/man2/write.2:211
12079 msgid ""
12080 "If a B<write>()  is interrupted by a signal handler before any bytes are "
12081 "written, then the call fails with the error B<EINTR>; if it is interrupted "
12082 "after at least one byte has been written, the call succeeds, and returns the "
12083 "number of bytes written."
12084 msgstr ""
12085
12086 #. type: Plain text
12087 #: build/C/man2/write.2:223
12088 msgid ""
12089 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
12090 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
12091 msgstr ""