OSDN Git Service

03a3f5a1e96cd2c5f2d9dca1e4d7170a45cbf985
[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-03-22 01:07+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
27 #, no-wrap
28 msgid "2001-12-18"
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:52 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:53 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:55 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:66 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, and return a "
94 "pointer to it via the first argument.  This pointer should be passed to "
95 "B<free>(3)  to release the allocated storage when it is no longer needed."
96 msgstr ""
97
98 #. type: SH
99 #: build/C/man3/asprintf.3: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:114 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:65 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:153 build/C/man2/open.2:477 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:531 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:187 build/C/man2/write.2:89
100 #, no-wrap
101 msgid "RETURN VALUE"
102 msgstr ""
103
104 #. type: Plain text
105 #: build/C/man3/asprintf.3:61
106 msgid ""
107 "When successful, these functions return the number of bytes printed, just "
108 "like B<sprintf>(3).  If memory allocation wasn't possible, or some other "
109 "error occurs, these functions will return -1, and the contents of I<strp> is "
110 "undefined."
111 msgstr ""
112
113 #. type: SH
114 #: build/C/man3/asprintf.3:61 build/C/man3/ctermid.3:61 build/C/man3/dprintf.3:69 build/C/man3/fclose.3:90 build/C/man3/fcloseall.3:55 build/C/man3/ferror.3:107 build/C/man3/fflush.3:93 build/C/man3/fgetwc.3:67 build/C/man3/flockfile.3:121 build/C/man3/fmemopen.3:195 build/C/man3/fmtmsg.3:225 build/C/man3/fopen.3:246 build/C/man3/fopencookie.3:245 build/C/man3/fpurge.3:70 build/C/man3/fputwc.3:65 build/C/man3/fread.3:103 build/C/man3/fseek.3:168 build/C/man3/fseeko.3:77 build/C/man3/getline.3:134 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:191 build/C/man2/open.2:629 build/C/man3/perror.3:111 build/C/man2/pipe.2:118 build/C/man3/popen.3:169 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:578 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:96 build/C/man3/tmpfile.3:76 build/C/man3/tmpnam.3:77 build/C/man2/unlink.2:141 build/C/man3/unlocked_stdio.3:113 build/C/man3/wprintf.3:195 build/C/man2/write.2:185
115 #, no-wrap
116 msgid "CONFORMING TO"
117 msgstr ""
118
119 #. type: Plain text
120 #: build/C/man3/asprintf.3:67
121 msgid ""
122 "These functions are GNU extensions, not in C or POSIX.  They are also "
123 "available under *BSD.  The FreeBSD implementation sets I<strp> to NULL on "
124 "error."
125 msgstr ""
126
127 #. type: SH
128 #: build/C/man3/asprintf.3:67 build/C/man3/ctermid.3:71 build/C/man3/dprintf.3:95 build/C/man3/fclose.3:102 build/C/man3/fcloseall.3:57 build/C/man3/ferror.3:114 build/C/man3/fflush.3:108 build/C/man3/fgetwc.3:84 build/C/man3/flockfile.3:129 build/C/man3/fmemopen.3:341 build/C/man3/fmtmsg.3:297 build/C/man3/fopen.3:348 build/C/man3/fopencookie.3:437 build/C/man3/fpurge.3:80 build/C/man3/fputwc.3:82 build/C/man3/fread.3:105 build/C/man3/fseek.3:170 build/C/man3/fseeko.3:83 build/C/man3/getline.3:168 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:236 build/C/man3/lseek64.3:159 build/C/man2/open.2:901 build/C/man3/perror.3:139 build/C/man2/pipe.2:190 build/C/man3/popen.3:198 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:716 build/C/man3/setbuf.3:200 build/C/man3/stdin.3:154 build/C/man3/stdio.3:250 build/C/man3/stdio_ext.3:132 build/C/man2/symlink.2:164 build/C/man7/symlink.7:471 build/C/man3/tempnam.3:166 build/C/man3/tmpfile.3:88 build/C/man3/tmpnam.3:153 build/C/man2/unlink.2:148 build/C/man3/unlocked_stdio.3:136 build/C/man3/wprintf.3:231 build/C/man2/write.2:211
129 #, no-wrap
130 msgid "SEE ALSO"
131 msgstr ""
132
133 #. type: Plain text
134 #: build/C/man3/asprintf.3:71
135 msgid "B<free>(3), B<malloc>(3), B<printf>(3)"
136 msgstr ""
137
138 #. type: SH
139 #: build/C/man3/asprintf.3:71 build/C/man3/ctermid.3:73 build/C/man3/dprintf.3:97 build/C/man3/fclose.3:108 build/C/man3/fcloseall.3:63 build/C/man3/ferror.3:119 build/C/man3/fflush.3:116 build/C/man3/fgetwc.3:89 build/C/man3/flockfile.3:131 build/C/man3/fmemopen.3:344 build/C/man3/fmtmsg.3:300 build/C/man3/fopen.3:354 build/C/man3/fopencookie.3:442 build/C/man3/fpurge.3:85 build/C/man3/fputwc.3:86 build/C/man3/fread.3:111 build/C/man3/fseek.3:173 build/C/man3/fseeko.3:85 build/C/man3/getline.3:175 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:243 build/C/man3/lseek64.3:162 build/C/man2/open.2:923 build/C/man3/perror.3:144 build/C/man2/pipe.2:197 build/C/man3/popen.3:208 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:723 build/C/man3/setbuf.3:208 build/C/man3/stdin.3:160 build/C/man3/stdio.3:257 build/C/man3/stdio_ext.3:135 build/C/man2/symlink.2:176 build/C/man7/symlink.7:489 build/C/man3/tempnam.3:171 build/C/man3/tmpfile.3:94 build/C/man3/tmpnam.3:158 build/C/man2/unlink.2:161 build/C/man3/unlocked_stdio.3:139 build/C/man3/wprintf.3:238 build/C/man2/write.2:223
140 #, no-wrap
141 msgid "COLOPHON"
142 msgstr ""
143
144 #. type: Plain text
145 #: build/C/man3/asprintf.3:78 build/C/man3/ctermid.3:80 build/C/man3/dprintf.3:104 build/C/man3/fclose.3:115 build/C/man3/fcloseall.3:70 build/C/man3/ferror.3:126 build/C/man3/fflush.3:123 build/C/man3/fgetwc.3:96 build/C/man3/flockfile.3:138 build/C/man3/fmemopen.3:351 build/C/man3/fmtmsg.3:307 build/C/man3/fopen.3:361 build/C/man3/fopencookie.3:449 build/C/man3/fpurge.3:92 build/C/man3/fputwc.3:93 build/C/man3/fread.3:118 build/C/man3/fseek.3:180 build/C/man3/fseeko.3:92 build/C/man3/getline.3:182 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:250 build/C/man3/lseek64.3:169 build/C/man2/open.2:930 build/C/man3/perror.3:151 build/C/man2/pipe.2:204 build/C/man3/popen.3:215 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:730 build/C/man3/setbuf.3:215 build/C/man3/stdin.3:167 build/C/man3/stdio.3:264 build/C/man3/stdio_ext.3:142 build/C/man2/symlink.2:183 build/C/man7/symlink.7:496 build/C/man3/tempnam.3:178 build/C/man3/tmpfile.3:101 build/C/man3/tmpnam.3:165 build/C/man2/unlink.2:168 build/C/man3/unlocked_stdio.3:146 build/C/man3/wprintf.3:245 build/C/man2/write.2:230
146 msgid ""
147 "This page is part of release 3.50 of the Linux I<man-pages> project.  A "
148 "description of the project, and information about reporting bugs, can be "
149 "found at http://www.kernel.org/doc/man-pages/."
150 msgstr ""
151
152 #. type: TH
153 #: build/C/man3/ctermid.3:26
154 #, no-wrap
155 msgid "CTERMID"
156 msgstr ""
157
158 #. type: TH
159 #: build/C/man3/ctermid.3:26
160 #, no-wrap
161 msgid "2007-07-26"
162 msgstr ""
163
164 #. type: Plain text
165 #: build/C/man3/ctermid.3:29
166 msgid "ctermid - get controlling terminal name"
167 msgstr ""
168
169 #. type: Plain text
170 #: 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
171 #, no-wrap
172 msgid "B<#include E<lt>stdio.hE<gt>>\n"
173 msgstr ""
174
175 #. type: Plain text
176 #: build/C/man3/ctermid.3:36
177 #, no-wrap
178 msgid "B<char *ctermid(char *>I<s>B<);>\n"
179 msgstr ""
180
181 #. type: Plain text
182 #: build/C/man3/ctermid.3: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
183 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
184 msgstr ""
185
186 #.  From <unistd.h>: _XOPEN_SOURCE
187 #. type: Plain text
188 #: build/C/man3/ctermid.3:46
189 msgid "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
190 msgstr ""
191
192 #. type: Plain text
193 #: build/C/man3/ctermid.3:59
194 msgid ""
195 "B<ctermid>()  returns a string which is the pathname for the current "
196 "controlling terminal for this process.  If I<s> is NULL, a static buffer is "
197 "used, otherwise I<s> points to a buffer used to hold the terminal pathname.  "
198 "The symbolic constant B<L_ctermid> is the maximum number of characters in "
199 "the returned pathname."
200 msgstr ""
201
202 #. type: Plain text
203 #: build/C/man3/ctermid.3:61
204 msgid "The pointer to the pathname."
205 msgstr ""
206
207 #. type: Plain text
208 #: build/C/man3/ctermid.3:63
209 msgid "Svr4, POSIX.1-2001."
210 msgstr ""
211
212 #. type: SH
213 #: build/C/man3/ctermid.3:63 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:890 build/C/man3/popen.3:175 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:647 build/C/man3/setbuf.3:170 build/C/man3/tempnam.3:156 build/C/man3/tmpnam.3:146 build/C/man2/unlink.2:145
214 #, no-wrap
215 msgid "BUGS"
216 msgstr ""
217
218 #. type: Plain text
219 #: build/C/man3/ctermid.3:67
220 msgid ""
221 "The path returned may not uniquely identify the controlling terminal; it "
222 "may, for example, be I</dev/tty>."
223 msgstr ""
224
225 #.  in glibc 2.3.x, x >= 4, the glibc headers threw an error
226 #.  if ctermid() was given an argument; fixed in 2.4.
227 #. type: Plain text
228 #: build/C/man3/ctermid.3:71
229 msgid "It is not assured that the program can open the terminal."
230 msgstr ""
231
232 #. type: Plain text
233 #: build/C/man3/ctermid.3:73
234 msgid "B<ttyname>(3)"
235 msgstr ""
236
237 #. type: TH
238 #: build/C/man3/dprintf.3:26
239 #, no-wrap
240 msgid "DPRINTF"
241 msgstr ""
242
243 #. type: TH
244 #: build/C/man3/dprintf.3:26
245 #, no-wrap
246 msgid "2010-09-15"
247 msgstr ""
248
249 #. type: Plain text
250 #: build/C/man3/dprintf.3:29
251 msgid "dprintf, vdprintf - print to a file descriptor"
252 msgstr ""
253
254 #. type: Plain text
255 #: build/C/man3/dprintf.3:33
256 msgid "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
257 msgstr ""
258
259 #. type: Plain text
260 #: build/C/man3/dprintf.3:35
261 msgid "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
262 msgstr ""
263
264 #. type: Plain text
265 #: build/C/man3/dprintf.3:43
266 msgid "B<dprintf>(), B<vdprintf>():"
267 msgstr ""
268
269 #. type: TP
270 #: build/C/man3/dprintf.3:46 build/C/man3/fmemopen.3:37 build/C/man3/getline.3:49
271 #, no-wrap
272 msgid "Since glibc 2.10:"
273 msgstr ""
274
275 #. type: Plain text
276 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40
277 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
278 msgstr ""
279
280 #. type: TP
281 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40 build/C/man3/getline.3:52
282 #, no-wrap
283 msgid "Before glibc 2.10:"
284 msgstr ""
285
286 #. type: Plain text
287 #: 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
288 msgid "_GNU_SOURCE"
289 msgstr ""
290
291 #. type: Plain text
292 #: build/C/man3/dprintf.3:69
293 msgid ""
294 "The functions B<dprintf>()  and B<vdprintf>()  (as found in the glibc2 "
295 "library) are exact analogs of B<fprintf>(3)  and B<vfprintf>(3), except that "
296 "they output to a file descriptor I<fd> instead of to a I<stdio> stream."
297 msgstr ""
298
299 #.  .SH NOTES
300 #.  These functions are GNU extensions, not in C or POSIX.
301 #.  Clearly, the names were badly chosen.
302 #.  Many systems (like MacOS) have incompatible functions called
303 #.  .BR dprintf (),
304 #.  usually some debugging version of
305 #.  .BR printf (3),
306 #.  perhaps with a prototype like
307 #
308 #.  .BI "void dprintf(int level, const char *" format ", ...);"
309 #
310 #.  where the first argument is a debugging level (and output is to
311 #.  .IR stderr ).
312 #.  Moreover,
313 #.  .BR dprintf ()
314 #.  (or
315 #.  .BR DPRINTF )
316 #.  is also a popular macro name for a debugging printf.
317 #.  So, probably, it is better to avoid this function in programs
318 #.  intended to be portable.
319 #
320 #.  A better name would have been
321 #.  .BR fdprintf ().
322 #. type: Plain text
323 #: build/C/man3/dprintf.3:95
324 msgid ""
325 "These functions are GNU extensions that are nowadays specified in "
326 "POSIX.1-2008."
327 msgstr ""
328
329 #. type: Plain text
330 #: build/C/man3/dprintf.3:97
331 msgid "B<printf>(3)"
332 msgstr ""
333
334 #. type: TH
335 #: build/C/man3/fclose.3:44
336 #, no-wrap
337 msgid "FCLOSE"
338 msgstr ""
339
340 #. type: TH
341 #: build/C/man3/fclose.3:44
342 #, no-wrap
343 msgid "2009-02-23"
344 msgstr ""
345
346 #. type: Plain text
347 #: build/C/man3/fclose.3:47
348 msgid "fclose - close a stream"
349 msgstr ""
350
351 #. type: Plain text
352 #: build/C/man3/fclose.3:51
353 msgid "B<int fclose(FILE *>I<fp>B<);>"
354 msgstr ""
355
356 #. type: Plain text
357 #: build/C/man3/fclose.3:59
358 msgid ""
359 "The B<fclose>()  function flushes the stream pointed to by I<fp> (writing "
360 "any buffered output data using B<fflush>(3))  and closes the underlying file "
361 "descriptor."
362 msgstr ""
363
364 #. type: Plain text
365 #: build/C/man3/fclose.3:70
366 msgid ""
367 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
368 "I<errno> is set to indicate the error.  In either case any further access "
369 "(including another call to B<fclose>())  to the stream results in undefined "
370 "behavior."
371 msgstr ""
372
373 #. type: SH
374 #: build/C/man3/fclose.3:70 build/C/man3/ferror.3:97 build/C/man3/fflush.3:81 build/C/man3/fgetwc.3:61 build/C/man3/flockfile.3:119 build/C/man3/fopen.3:201 build/C/man3/fpurge.3:65 build/C/man3/fputwc.3:60 build/C/man3/fseek.3:136 build/C/man3/fseeko.3:74 build/C/man3/getline.3:122 build/C/man2/link.2:57 build/C/man2/llseek.2:69 build/C/man2/lseek.2:161 build/C/man2/open.2:485 build/C/man2/pipe.2:97 build/C/man3/popen.3:143 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:548 build/C/man2/symlink.2:89 build/C/man3/tempnam.3:92 build/C/man3/tmpfile.3:54 build/C/man3/tmpnam.3:75 build/C/man2/unlink.2:60 build/C/man2/write.2:107
375 #, no-wrap
376 msgid "ERRORS"
377 msgstr ""
378
379 #. type: TP
380 #: build/C/man3/fclose.3: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:162 build/C/man2/read.2:114 build/C/man3/scanf.3:554 build/C/man2/write.2:126
381 #, no-wrap
382 msgid "B<EBADF>"
383 msgstr ""
384
385 #.   This error cannot occur unless you are mixing ANSI C stdio operations and
386 #.   low-level file operations on the same stream. If you do get this error,
387 #.   you must have closed the stream's low-level file descriptor using
388 #.   something like close(fileno(fp)).
389 #. type: Plain text
390 #: build/C/man3/fclose.3:80
391 msgid "The file descriptor underlying I<fp> is not valid."
392 msgstr ""
393
394 #. type: Plain text
395 #: build/C/man3/fclose.3:90
396 msgid ""
397 "The B<fclose>()  function may also fail and set I<errno> for any of the "
398 "errors specified for the routines B<close>(2), B<write>(2)  or B<fflush>(3)."
399 msgstr ""
400
401 #. type: Plain text
402 #: build/C/man3/fclose.3:92 build/C/man3/fseek.3:170 build/C/man3/puts.3:105
403 msgid "C89, C99."
404 msgstr ""
405
406 #. type: SH
407 #: build/C/man3/fclose.3:92 build/C/man3/fflush.3:99 build/C/man3/fgetwc.3:69 build/C/man3/fmemopen.3:207 build/C/man3/fmtmsg.3:240 build/C/man3/fopen.3:255 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:67 build/C/man3/fseeko.3:79 build/C/man2/link.2:143 build/C/man2/llseek.2:84 build/C/man2/lseek.2:201 build/C/man2/open.2:655 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:609 build/C/man3/stdin.3:122 build/C/man2/symlink.2:155 build/C/man3/tempnam.3:101 build/C/man3/tmpfile.3:78 build/C/man3/tmpnam.3:82 build/C/man3/wprintf.3:197 build/C/man2/write.2:194
408 #, no-wrap
409 msgid "NOTES"
410 msgstr ""
411
412 #. type: Plain text
413 #: build/C/man3/fclose.3:102
414 msgid ""
415 "Note that B<fclose>()  only flushes the user-space buffers provided by the C "
416 "library.  To ensure that the data is physically stored on disk the kernel "
417 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
418 msgstr ""
419
420 #. type: Plain text
421 #: build/C/man3/fclose.3:108
422 msgid "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
423 msgstr ""
424
425 #. type: TH
426 #: build/C/man3/fcloseall.3:25
427 #, no-wrap
428 msgid "FCLOSEALL"
429 msgstr ""
430
431 #. type: TH
432 #: build/C/man3/fcloseall.3:25
433 #, no-wrap
434 msgid "2006-12-27"
435 msgstr ""
436
437 #. type: Plain text
438 #: build/C/man3/fcloseall.3:28
439 msgid "fcloseall - close all open streams"
440 msgstr ""
441
442 #. type: Plain text
443 #: build/C/man3/fcloseall.3:32 build/C/man3/fopencookie.3:33
444 #, no-wrap
445 msgid ""
446 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
447 "B<#include E<lt>stdio.hE<gt>>\n"
448 msgstr ""
449
450 #. type: Plain text
451 #: build/C/man3/fcloseall.3:34
452 #, no-wrap
453 msgid "B<int fcloseall(void);>\n"
454 msgstr ""
455
456 #. type: Plain text
457 #: build/C/man3/fcloseall.3:43
458 msgid ""
459 "The B<fcloseall>()  function closes all of the calling process's open "
460 "streams.  Buffered output for each stream is written before it is closed (as "
461 "for B<fflush>(3)); buffered input is discarded."
462 msgstr ""
463
464 #. type: Plain text
465 #: build/C/man3/fcloseall.3:50
466 msgid "The standard streams, I<stdin>, I<stdout>, and I<stderr> are also closed."
467 msgstr ""
468
469 #. type: Plain text
470 #: build/C/man3/fcloseall.3:55
471 msgid ""
472 "This function returns 0 if all files were successfully closed; on error, "
473 "B<EOF> is returned."
474 msgstr ""
475
476 #. type: Plain text
477 #: build/C/man3/fcloseall.3:57
478 msgid "This function is a GNU extension."
479 msgstr ""
480
481 #. type: Plain text
482 #: build/C/man3/fcloseall.3:63
483 msgid "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
484 msgstr ""
485
486 #. type: TH
487 #: build/C/man3/ferror.3:44
488 #, no-wrap
489 msgid "FERROR"
490 msgstr ""
491
492 #. type: TH
493 #: build/C/man3/ferror.3:44 build/C/man3/flockfile.3:25 build/C/man3/unlocked_stdio.3:25
494 #, no-wrap
495 msgid "2008-08-29"
496 msgstr ""
497
498 #. type: Plain text
499 #: build/C/man3/ferror.3:47
500 msgid "clearerr, feof, ferror, fileno - check and reset stream status"
501 msgstr ""
502
503 #. type: Plain text
504 #: build/C/man3/ferror.3:51
505 msgid "B<void clearerr(FILE *>I<stream>B<);>"
506 msgstr ""
507
508 #. type: Plain text
509 #: build/C/man3/ferror.3:53
510 msgid "B<int feof(FILE *>I<stream>B<);>"
511 msgstr ""
512
513 #. type: Plain text
514 #: build/C/man3/ferror.3:55
515 msgid "B<int ferror(FILE *>I<stream>B<);>"
516 msgstr ""
517
518 #. type: Plain text
519 #: build/C/man3/ferror.3:57
520 msgid "B<int fileno(FILE *>I<stream>B<);>"
521 msgstr ""
522
523 #. type: Plain text
524 #: build/C/man3/ferror.3:65
525 msgid "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
526 msgstr ""
527
528 #. type: Plain text
529 #: build/C/man3/ferror.3:70
530 msgid ""
531 "The function B<clearerr>()  clears the end-of-file and error indicators for "
532 "the stream pointed to by I<stream>."
533 msgstr ""
534
535 #. type: Plain text
536 #: build/C/man3/ferror.3:79
537 msgid ""
538 "The function B<feof>()  tests the end-of-file indicator for the stream "
539 "pointed to by I<stream>, returning nonzero if it is set.  The end-of-file "
540 "indicator can only be cleared by the function B<clearerr>()."
541 msgstr ""
542
543 #. type: Plain text
544 #: build/C/man3/ferror.3:88
545 msgid ""
546 "The function B<ferror>()  tests the error indicator for the stream pointed "
547 "to by I<stream>, returning nonzero if it is set.  The error indicator can "
548 "only be reset by the B<clearerr>()  function."
549 msgstr ""
550
551 #. type: Plain text
552 #: build/C/man3/ferror.3:94
553 msgid ""
554 "The function B<fileno>()  examines the argument I<stream> and returns its "
555 "integer descriptor."
556 msgstr ""
557
558 #. type: Plain text
559 #: build/C/man3/ferror.3:97 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
560 msgid "For nonlocking counterparts, see B<unlocked_stdio>(3)."
561 msgstr ""
562
563 #. type: Plain text
564 #: build/C/man3/ferror.3:107
565 msgid ""
566 "These functions should not fail and do not set the external variable "
567 "I<errno>.  (However, in case B<fileno>()  detects that its argument is not a "
568 "valid stream, it must return -1 and set I<errno> to B<EBADF>.)"
569 msgstr ""
570
571 #. type: Plain text
572 #: build/C/man3/ferror.3:114
573 msgid ""
574 "The functions B<clearerr>(), B<feof>(), and B<ferror>()  conform to C89 and "
575 "C99."
576 msgstr ""
577
578 #. type: Plain text
579 #: build/C/man3/ferror.3:119
580 msgid "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
581 msgstr ""
582
583 #. type: TH
584 #: build/C/man3/fflush.3:45
585 #, no-wrap
586 msgid "FFLUSH"
587 msgstr ""
588
589 #. type: TH
590 #: build/C/man3/fflush.3:45
591 #, no-wrap
592 msgid "2009-09-06"
593 msgstr ""
594
595 #. type: Plain text
596 #: build/C/man3/fflush.3:48
597 msgid "fflush - flush a stream"
598 msgstr ""
599
600 #. type: Plain text
601 #: build/C/man3/fflush.3:52
602 msgid "B<int fflush(FILE *>I<stream>B<);>"
603 msgstr ""
604
605 #. type: Plain text
606 #: build/C/man3/fflush.3:63
607 msgid ""
608 "For output streams, B<fflush>()  forces a write of all user-space buffered "
609 "data for the given output or update I<stream> via the stream's underlying "
610 "write function.  For input streams, B<fflush>()  discards any buffered data "
611 "that has been fetched from the underlying file, but has not been consumed by "
612 "the application.  The open status of the stream is unaffected."
613 msgstr ""
614
615 #. type: Plain text
616 #: build/C/man3/fflush.3:71
617 msgid ""
618 "If the I<stream> argument is NULL, B<fflush>()  flushes I<all> open output "
619 "streams."
620 msgstr ""
621
622 #. type: Plain text
623 #: build/C/man3/fflush.3:74
624 msgid "For a nonlocking counterpart, see B<unlocked_stdio>(3)."
625 msgstr ""
626
627 #. type: Plain text
628 #: build/C/man3/fflush.3:81
629 msgid ""
630 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
631 "I<errno> is set to indicate the error."
632 msgstr ""
633
634 #. type: Plain text
635 #: build/C/man3/fflush.3:86
636 msgid "I<Stream> is not an open stream, or is not open for writing."
637 msgstr ""
638
639 #. type: Plain text
640 #: build/C/man3/fflush.3:93
641 msgid ""
642 "The function B<fflush>()  may also fail and set I<errno> for any of the "
643 "errors specified for B<write>(2)."
644 msgstr ""
645
646 #. type: Plain text
647 #: build/C/man3/fflush.3:95
648 msgid "C89, C99, POSIX.1-2001, POSIX.1-2008."
649 msgstr ""
650
651 #.  Verified on: Solaris 8.
652 #. type: Plain text
653 #: build/C/man3/fflush.3:99
654 msgid ""
655 "The standards do not specify the behavior for input streams.  Most other "
656 "implementations behave the same as Linux."
657 msgstr ""
658
659 #. type: Plain text
660 #: build/C/man3/fflush.3:108
661 msgid ""
662 "Note that B<fflush>()  only flushes the user-space buffers provided by the C "
663 "library.  To ensure that the data is physically stored on disk the kernel "
664 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
665 msgstr ""
666
667 #. type: Plain text
668 #: build/C/man3/fflush.3:116
669 msgid ""
670 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
671 "B<setbuf>(3), B<unlocked_stdio>(3)"
672 msgstr ""
673
674 #. type: TH
675 #: build/C/man3/fgetwc.3:18
676 #, no-wrap
677 msgid "FGETWC"
678 msgstr ""
679
680 #. type: TH
681 #: build/C/man3/fgetwc.3:18 build/C/man3/fputwc.3:16
682 #, no-wrap
683 msgid "1999-07-25"
684 msgstr ""
685
686 #. type: Plain text
687 #: build/C/man3/fgetwc.3:21
688 msgid "fgetwc, getwc - read a wide character from a FILE stream"
689 msgstr ""
690
691 #. type: Plain text
692 #: build/C/man3/fgetwc.3:26 build/C/man3/fmemopen.3:22 build/C/man3/fputwc.3:24 build/C/man3/unlocked_stdio.3:54
693 #, no-wrap
694 msgid "B<#include E<lt>wchar.hE<gt>>\n"
695 msgstr ""
696
697 #. type: Plain text
698 #: build/C/man3/fgetwc.3:29
699 #, no-wrap
700 msgid ""
701 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
702 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
703 msgstr ""
704
705 #. type: Plain text
706 #: build/C/man3/fgetwc.3:44
707 msgid ""
708 "The B<fgetwc>()  function is the wide-character equivalent of the "
709 "B<fgetc>(3)  function.  It reads a wide character from I<stream> and returns "
710 "it.  If the end of stream is reached, or if I<ferror(stream)> becomes true, "
711 "it returns B<WEOF>.  If a wide-character conversion error occurs, it sets "
712 "I<errno> to B<EILSEQ> and returns B<WEOF>."
713 msgstr ""
714
715 #. type: Plain text
716 #: build/C/man3/fgetwc.3:52
717 msgid ""
718 "The B<getwc>()  function or macro functions identically to B<fgetwc>().  It "
719 "may be implemented as a macro, and may evaluate its argument more than "
720 "once.  There is no reason ever to use it."
721 msgstr ""
722
723 #. type: Plain text
724 #: build/C/man3/fgetwc.3:61
725 msgid ""
726 "The B<fgetwc>()  function returns the next wide-character from the stream, "
727 "or B<WEOF>."
728 msgstr ""
729
730 #. type: Plain text
731 #: build/C/man3/fgetwc.3:63 build/C/man3/fputwc.3:62
732 msgid "Apart from the usual ones, there is"
733 msgstr ""
734
735 #. type: TP
736 #: build/C/man3/fgetwc.3:63 build/C/man3/fputwc.3:62 build/C/man3/scanf.3:559
737 #, no-wrap
738 msgid "B<EILSEQ>"
739 msgstr ""
740
741 #. type: Plain text
742 #: build/C/man3/fgetwc.3:67
743 msgid "The data obtained from the input stream does not form a valid character."
744 msgstr ""
745
746 #. type: Plain text
747 #: build/C/man3/fgetwc.3:69 build/C/man3/fputwc.3:67
748 msgid "C99, POSIX.1-2001."
749 msgstr ""
750
751 #. type: Plain text
752 #: build/C/man3/fgetwc.3:76
753 msgid ""
754 "The behavior of B<fgetwc>()  depends on the B<LC_CTYPE> category of the "
755 "current locale."
756 msgstr ""
757
758 #. type: Plain text
759 #: build/C/man3/fgetwc.3:84
760 msgid ""
761 "In the absence of additional information passed to the B<fopen>(3)  call, it "
762 "is reasonable to expect that B<fgetwc>()  will actually read a multibyte "
763 "sequence from the stream and then convert it to a wide character."
764 msgstr ""
765
766 #. type: Plain text
767 #: build/C/man3/fgetwc.3:89
768 msgid "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
769 msgstr ""
770
771 #. type: TH
772 #: build/C/man3/flockfile.3:25
773 #, no-wrap
774 msgid "FLOCKFILE"
775 msgstr ""
776
777 #. type: Plain text
778 #: build/C/man3/flockfile.3:28
779 msgid "flockfile, ftrylockfile, funlockfile - lock FILE for stdio"
780 msgstr ""
781
782 #. type: Plain text
783 #: build/C/man3/flockfile.3:33
784 #, no-wrap
785 msgid "B<void flockfile(FILE *>I<filehandle>B<);>\n"
786 msgstr ""
787
788 #. type: Plain text
789 #: build/C/man3/flockfile.3:35
790 #, no-wrap
791 msgid "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
792 msgstr ""
793
794 #. type: Plain text
795 #: build/C/man3/flockfile.3:37
796 #, no-wrap
797 msgid "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
798 msgstr ""
799
800 #. type: Plain text
801 #: build/C/man3/flockfile.3:46 build/C/man3/wprintf.3:43
802 msgid "All functions shown above:"
803 msgstr ""
804
805 #. type: Plain text
806 #: build/C/man3/flockfile.3:49
807 msgid ""
808 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
809 "|| _POSIX_SOURCE"
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man3/flockfile.3:63
814 msgid ""
815 "The stdio functions are thread-safe.  This is achieved by assigning to each "
816 "I<FILE> object a lockcount and (if the lockcount is nonzero)  an owning "
817 "thread.  For each library call, these functions wait until the I<FILE> "
818 "object is no longer locked by a different thread, then lock it, do the "
819 "requested I/O, and unlock the object again."
820 msgstr ""
821
822 #. type: Plain text
823 #: build/C/man3/flockfile.3:69
824 msgid ""
825 "(Note: this locking has nothing to do with the file locking done by "
826 "functions like B<flock>(2)  and B<lockf>(3).)"
827 msgstr ""
828
829 #. type: Plain text
830 #: build/C/man3/flockfile.3:77
831 msgid ""
832 "All this is invisible to the C-programmer, but there may be two reasons to "
833 "wish for more detailed control.  On the one hand, maybe a series of I/O "
834 "actions by one thread belongs together, and should not be interrupted by the "
835 "I/O of some other thread.  On the other hand, maybe the locking overhead "
836 "should be avoided for greater efficiency."
837 msgstr ""
838
839 #. type: Plain text
840 #: build/C/man3/flockfile.3:94
841 msgid ""
842 "To this end, a thread can explicitly lock the I<FILE> object, then do its "
843 "series of I/O actions, then unlock.  This prevents other threads from coming "
844 "in between.  If the reason for doing this was to achieve greater efficiency, "
845 "one does the I/O with the nonlocking versions of the stdio functions: with "
846 "B<getc_unlocked>(3)  and B<putc_unlocked>(3)  instead of B<getc>(3)  and "
847 "B<putc>(3)."
848 msgstr ""
849
850 #. type: Plain text
851 #: build/C/man3/flockfile.3:101
852 msgid ""
853 "The B<flockfile>()  function waits for I<*filehandle> to be no longer locked "
854 "by a different thread, then makes the current thread owner of "
855 "I<*filehandle>, and increments the lockcount."
856 msgstr ""
857
858 #. type: Plain text
859 #: build/C/man3/flockfile.3:105
860 msgid "The B<funlockfile>()  function decrements the lock count."
861 msgstr ""
862
863 #. type: Plain text
864 #: build/C/man3/flockfile.3:114
865 msgid ""
866 "The B<ftrylockfile>()  function is a nonblocking version of B<flockfile>().  "
867 "It does nothing in case some other thread owns I<*filehandle>, and it "
868 "obtains ownership and increments the lockcount otherwise."
869 msgstr ""
870
871 #. type: Plain text
872 #: build/C/man3/flockfile.3:119
873 msgid ""
874 "The B<ftrylockfile>()  function returns zero for success (the lock was "
875 "obtained), and nonzero for failure."
876 msgstr ""
877
878 #. type: Plain text
879 #: build/C/man3/flockfile.3:121
880 msgid "None."
881 msgstr ""
882
883 #. type: Plain text
884 #: build/C/man3/flockfile.3:123 build/C/man3/popen.3:171
885 msgid "POSIX.1-2001."
886 msgstr ""
887
888 #. type: SH
889 #: build/C/man3/flockfile.3:123
890 #, no-wrap
891 msgid "AVAILABILITY"
892 msgstr ""
893
894 #. type: Plain text
895 #: build/C/man3/flockfile.3:129
896 msgid ""
897 "These functions are available when B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
898 "defined.  They are in libc since libc 5.1.1 and in glibc since glibc 2.0."
899 msgstr ""
900
901 #. type: Plain text
902 #: build/C/man3/flockfile.3:131
903 msgid "B<unlocked_stdio>(3)"
904 msgstr ""
905
906 #. type: TH
907 #: build/C/man3/fmemopen.3:10
908 #, no-wrap
909 msgid "FMEMOPEN"
910 msgstr ""
911
912 #. type: TH
913 #: build/C/man3/fmemopen.3:10
914 #, no-wrap
915 msgid "2012-04-28"
916 msgstr ""
917
918 #. type: Plain text
919 #: build/C/man3/fmemopen.3:13
920 msgid "fmemopen, open_memstream, open_wmemstream - open memory as stream"
921 msgstr ""
922
923 #. type: Plain text
924 #: build/C/man3/fmemopen.3:18
925 #, no-wrap
926 msgid ""
927 "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char "
928 "*>I<mode>B<);>\n"
929 msgstr ""
930
931 #. type: Plain text
932 #: build/C/man3/fmemopen.3:20
933 #, no-wrap
934 msgid "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
935 msgstr ""
936
937 #. type: Plain text
938 #: build/C/man3/fmemopen.3:24
939 #, no-wrap
940 msgid "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
941 msgstr ""
942
943 #. type: Plain text
944 #: build/C/man3/fmemopen.3:34
945 msgid "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
946 msgstr ""
947
948 #. type: Plain text
949 #: build/C/man3/fmemopen.3:57
950 msgid ""
951 "The B<fmemopen>()  function opens a stream that permits the access specified "
952 "by I<mode>.  The stream allows I/O to be performed on the string or memory "
953 "buffer pointed to by I<buf>.  This buffer must be at least I<size> bytes "
954 "long."
955 msgstr ""
956
957 #. type: Plain text
958 #: build/C/man3/fmemopen.3:77
959 msgid ""
960 "The argument I<mode> is the same as for B<fopen>(3).  If I<mode> specifies "
961 "an append mode, then the initial file position is set to the location of the "
962 "first null byte (\\(aq\\e0\\(aq) in the buffer; otherwise the initial file "
963 "position is set to the start of the buffer.  Since glibc 2.9, the letter "
964 "\\(aqb\\(aq may be specified as the second character in I<mode>.  This "
965 "provides \"binary\" mode: writes don't implicitly add a terminating null "
966 "byte, and B<fseek>(3)  B<SEEK_END> is relative to the end of the buffer "
967 "(i.e., the value specified by the I<size> argument), rather than the current "
968 "string length."
969 msgstr ""
970
971 #. type: Plain text
972 #: build/C/man3/fmemopen.3:89
973 msgid ""
974 "When a stream that has been opened for writing is flushed (B<fflush>(3))  or "
975 "closed (B<fclose>(3)), a null byte is written at the end of the buffer if "
976 "there is space.  The caller should ensure that an extra byte is available in "
977 "the buffer (and that I<size> counts that byte)  to allow for this."
978 msgstr ""
979
980 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1995
981 #.  and
982 #.  http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html
983 #. type: Plain text
984 #: build/C/man3/fmemopen.3:107
985 msgid ""
986 "Attempts to write more than I<size> bytes to the buffer result in an error.  "
987 "(By default, such errors will only be visible when the I<stdio> buffer is "
988 "flushed.  Disabling buffering with I<setbuf(fp,\\ NULL)> may be useful to "
989 "detect errors at the time of an output operation.  Alternatively, the caller "
990 "can explicitly set I<buf> as the stdio stream buffer, at the same time "
991 "informing stdio of the buffer's size, using I<setbuffer(fp, buf, size)>.)"
992 msgstr ""
993
994 #. type: Plain text
995 #: build/C/man3/fmemopen.3:115
996 msgid ""
997 "In a stream opened for reading, null bytes (\\(aq\\e0\\(aq) in the buffer do "
998 "not cause read operations to return an end-of-file indication.  A read from "
999 "the buffer will only indicate end-of-file when the file pointer advances "
1000 "I<size> bytes past the start of the buffer."
1001 msgstr ""
1002
1003 #. type: Plain text
1004 #: build/C/man3/fmemopen.3:130
1005 msgid ""
1006 "If I<buf> is specified as NULL, then B<fmemopen>()  dynamically allocates a "
1007 "buffer I<size> bytes long.  This is useful for an application that wants to "
1008 "write data to a temporary buffer and then read it back again.  The buffer is "
1009 "automatically freed when the stream is closed.  Note that the caller has no "
1010 "way to obtain a pointer to the temporary buffer allocated by this call (but "
1011 "see B<open_memstream>()  below)."
1012 msgstr ""
1013
1014 #. type: Plain text
1015 #: build/C/man3/fmemopen.3:141
1016 msgid ""
1017 "The B<open_memstream>()  function opens a stream for writing to a buffer.  "
1018 "The buffer is dynamically allocated (as with B<malloc>(3)), and "
1019 "automatically grows as required.  After closing the stream, the caller "
1020 "should B<free>(3)  this buffer."
1021 msgstr ""
1022
1023 #. type: Plain text
1024 #: build/C/man3/fmemopen.3:156
1025 msgid ""
1026 "When the stream is closed (B<fclose>(3))  or flushed (B<fflush>(3)), the "
1027 "locations pointed to by I<ptr> and I<sizeloc> are updated to contain, "
1028 "respectively, a pointer to the buffer and the current size of the buffer.  "
1029 "These values remain valid only as long as the caller performs no further "
1030 "output on the stream.  If further output is performed, then the stream must "
1031 "again be flushed before trying to access these variables."
1032 msgstr ""
1033
1034 #. type: Plain text
1035 #: build/C/man3/fmemopen.3:162
1036 msgid ""
1037 "A null byte is maintained at the end of the buffer.  This byte is I<not> "
1038 "included in the size value stored at I<sizeloc>."
1039 msgstr ""
1040
1041 #. type: Plain text
1042 #: build/C/man3/fmemopen.3:170
1043 msgid ""
1044 "The stream's file position can be changed with B<fseek>(3)  or "
1045 "B<fseeko>(3).  Moving the file position past the end of the data already "
1046 "written fills the intervening space with zeros."
1047 msgstr ""
1048
1049 #. type: Plain text
1050 #: build/C/man3/fmemopen.3:176
1051 msgid ""
1052 "The B<open_wmemstream>()  is similar to B<open_memstream>(), but operates on "
1053 "wide characters instead of bytes."
1054 msgstr ""
1055
1056 #. type: Plain text
1057 #: build/C/man3/fmemopen.3:188
1058 msgid ""
1059 "Upon successful completion B<fmemopen>(), B<open_memstream>()  and "
1060 "B<open_wmemstream>()  return a I<FILE> pointer.  Otherwise, NULL is returned "
1061 "and I<errno> is set to indicate the error."
1062 msgstr ""
1063
1064 #. type: SH
1065 #: build/C/man3/fmemopen.3:188 build/C/man3/fmtmsg.3:222 build/C/man3/getline.3:132 build/C/man2/pipe.2:113 build/C/man2/readv.2:209
1066 #, no-wrap
1067 msgid "VERSIONS"
1068 msgstr ""
1069
1070 #. type: Plain text
1071 #: build/C/man3/fmemopen.3:195
1072 msgid ""
1073 "B<fmemopen>()  and B<open_memstream>()  were already available in glibc "
1074 "1.0.x.  B<open_wmemstream>()  is available since glibc 2.4."
1075 msgstr ""
1076
1077 #. type: Plain text
1078 #: build/C/man3/fmemopen.3:199
1079 msgid ""
1080 "POSIX.1-2008.  These functions are not specified in POSIX.1-2001, and are "
1081 "not widely available on other systems."
1082 msgstr ""
1083
1084 #.  http://austingroupbugs.net/view.php?id=396
1085 #. type: Plain text
1086 #: build/C/man3/fmemopen.3:207
1087 msgid ""
1088 "POSIX.1-2008 specifies that \\(aqb\\(aq in I<mode> shall be ignored.  "
1089 "However, Technical Corrigendum 1 adjusts the standard to allow "
1090 "implementation-specific treatment for this case, thus permitting the glibc "
1091 "treatment of \\(aqb\\(aq."
1092 msgstr ""
1093
1094 #. type: Plain text
1095 #: build/C/man3/fmemopen.3:213
1096 msgid ""
1097 "There is no file descriptor associated with the file stream returned by "
1098 "these functions (i.e., B<fileno>(3)  will return an error if called on the "
1099 "returned stream)."
1100 msgstr ""
1101
1102 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=1996
1103 #. type: Plain text
1104 #: build/C/man3/fmemopen.3:220
1105 msgid ""
1106 "In glibc before version 2.7, seeking past the end of a stream created by "
1107 "B<open_memstream>()  does not enlarge the buffer; instead the B<fseek>(3)  "
1108 "call fails, returning -1."
1109 msgstr ""
1110
1111 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=11216
1112 #. type: Plain text
1113 #: build/C/man3/fmemopen.3:231
1114 msgid ""
1115 "If I<size> is specified as zero, B<fmemopen>()  fails with the error "
1116 "B<EINVAL>.  It would be more consistent if this case successfully created a "
1117 "stream that then returned end of file on the first attempt at reading.  "
1118 "Furthermore, POSIX.1-2008 does not specify a failure for this case."
1119 msgstr ""
1120
1121 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13152
1122 #. type: Plain text
1123 #: build/C/man3/fmemopen.3:239
1124 msgid ""
1125 "Specifying append mode (\"a\" or \"a+\") for B<fmemopen>()  sets the initial "
1126 "file position to the first null byte, but (if the file offset is reset to a "
1127 "location other than the end of the stream)  does not force subsequent writes "
1128 "to append at the end of the stream."
1129 msgstr ""
1130
1131 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13151
1132 #. type: Plain text
1133 #: build/C/man3/fmemopen.3:255
1134 msgid ""
1135 "If the I<mode> argument to B<fmemopen>()  specifies append (\"a\" or "
1136 "\"a+\"), and the I<size> argument does not cover a null byte in I<buf> then, "
1137 "according to POSIX.1-2008, the initial file position should be set to the "
1138 "next byte after the end of the buffer.  However, in this case the glibc "
1139 "B<fmemopen>()  sets the file position to -1."
1140 msgstr ""
1141
1142 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12836
1143 #. type: Plain text
1144 #: build/C/man3/fmemopen.3:268
1145 msgid ""
1146 "To specify binary mode for B<fmemopen>()  the \\(aqb\\(aq must be the "
1147 "I<second> character in I<mode>.  Thus, for example, \"wb+\" has the desired "
1148 "effect, but \"w+b\" does not.  This is inconsistent with the treatment of "
1149 "I<mode> by B<fopen>(3)."
1150 msgstr ""
1151
1152 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=6544
1153 #. type: Plain text
1154 #: build/C/man3/fmemopen.3:276
1155 msgid ""
1156 "The glibc 2.9 addition of \"binary\" mode for B<fmemopen>()  silently "
1157 "changed the ABI: previously, B<fmemopen>()  ignored \\(aqb\\(aq in I<mode>."
1158 msgstr ""
1159
1160 #. type: SH
1161 #: build/C/man3/fmemopen.3:276 build/C/man3/fmtmsg.3:244 build/C/man3/fopencookie.3:247 build/C/man3/getline.3:141 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:682
1162 #, no-wrap
1163 msgid "EXAMPLE"
1164 msgstr ""
1165
1166 #. type: Plain text
1167 #: build/C/man3/fmemopen.3:286
1168 msgid ""
1169 "The program below uses B<fmemopen>()  to open an input buffer, and "
1170 "B<open_memstream>()  to open a dynamically sized output buffer.  The program "
1171 "scans its input string (taken from the program's first command-line "
1172 "argument) reading integers, and writes the squares of these integers to the "
1173 "output buffer.  An example of the output produced by this program is the "
1174 "following:"
1175 msgstr ""
1176
1177 #. type: Plain text
1178 #: build/C/man3/fmemopen.3:291
1179 #, no-wrap
1180 msgid ""
1181 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1182 "size=11; ptr=1 529 1849\n"
1183 msgstr ""
1184
1185 #. type: SS
1186 #: build/C/man3/fmemopen.3:293 build/C/man3/fopencookie.3:271
1187 #, no-wrap
1188 msgid "Program source"
1189 msgstr ""
1190
1191 #. type: Plain text
1192 #: build/C/man3/fmemopen.3:300
1193 #, no-wrap
1194 msgid ""
1195 "#define _GNU_SOURCE\n"
1196 "#include E<lt>string.hE<gt>\n"
1197 "#include E<lt>stdio.hE<gt>\n"
1198 "#include E<lt>stdlib.hE<gt>\n"
1199 msgstr ""
1200
1201 #. type: Plain text
1202 #: build/C/man3/fmemopen.3:303
1203 #, no-wrap
1204 msgid ""
1205 "#define handle_error(msg) \\e\n"
1206 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1207 msgstr ""
1208
1209 #. type: Plain text
1210 #: build/C/man3/fmemopen.3:311
1211 #, no-wrap
1212 msgid ""
1213 "int\n"
1214 "main(int argc, char *argv[])\n"
1215 "{\n"
1216 "    FILE *out, *in;\n"
1217 "    int v, s;\n"
1218 "    size_t size;\n"
1219 "    char *ptr;\n"
1220 msgstr ""
1221
1222 #. type: Plain text
1223 #: build/C/man3/fmemopen.3:316
1224 #, no-wrap
1225 msgid ""
1226 "    if (argc != 2) {\n"
1227 "\tfprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1228 "\texit(EXIT_FAILURE);\n"
1229 "    }\n"
1230 msgstr ""
1231
1232 #. type: Plain text
1233 #: build/C/man3/fmemopen.3:320
1234 #, no-wrap
1235 msgid ""
1236 "    in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1237 "    if (in == NULL)\n"
1238 "        handle_error(\"fmemopen\");\n"
1239 msgstr ""
1240
1241 #. type: Plain text
1242 #: build/C/man3/fmemopen.3:324
1243 #, no-wrap
1244 msgid ""
1245 "    out = open_memstream(&ptr, &size);\n"
1246 "    if (out == NULL)\n"
1247 "        handle_error(\"open_memstream\");\n"
1248 msgstr ""
1249
1250 #. type: Plain text
1251 #: build/C/man3/fmemopen.3:329
1252 #, no-wrap
1253 msgid ""
1254 "    for (;;) {\n"
1255 "        s = fscanf(in, \"%d\", &v);\n"
1256 "        if (s E<lt>= 0)\n"
1257 "            break;\n"
1258 msgstr ""
1259
1260 #. type: Plain text
1261 #: build/C/man3/fmemopen.3:340
1262 #, no-wrap
1263 msgid ""
1264 "        s = fprintf(out, \"%d \", v * v);\n"
1265 "        if (s == -1)\n"
1266 "            handle_error(\"fprintf\");\n"
1267 "    }\n"
1268 "    fclose(in);\n"
1269 "    fclose(out);\n"
1270 "    printf(\"size=%ld; ptr=%s\\en\", (long) size, ptr);\n"
1271 "    free(ptr);\n"
1272 "    exit(EXIT_SUCCESS);\n"
1273 "}\n"
1274 msgstr ""
1275
1276 #. type: Plain text
1277 #: build/C/man3/fmemopen.3:344
1278 msgid "B<fopen>(3), B<fopencookie>(3)"
1279 msgstr ""
1280
1281 #. type: TH
1282 #: build/C/man3/fmtmsg.3:13
1283 #, no-wrap
1284 msgid "FMTMSG"
1285 msgstr ""
1286
1287 #. type: TH
1288 #: build/C/man3/fmtmsg.3:13
1289 #, no-wrap
1290 msgid "2008-06-14"
1291 msgstr ""
1292
1293 #. type: Plain text
1294 #: build/C/man3/fmtmsg.3:16
1295 msgid "fmtmsg - print formatted error messages"
1296 msgstr ""
1297
1298 #. type: Plain text
1299 #: build/C/man3/fmtmsg.3:19
1300 #, no-wrap
1301 msgid "B<#include E<lt>fmtmsg.hE<gt>>\n"
1302 msgstr ""
1303
1304 #. type: Plain text
1305 #: build/C/man3/fmtmsg.3:21
1306 #, no-wrap
1307 msgid "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
1308 msgstr ""
1309
1310 #. type: Plain text
1311 #: build/C/man3/fmtmsg.3:23
1312 #, no-wrap
1313 msgid "B<           int >I<severity>B<, const char *>I<text>B<,>\n"
1314 msgstr ""
1315
1316 #. type: Plain text
1317 #: build/C/man3/fmtmsg.3:25
1318 #, no-wrap
1319 msgid "B<           const char *>I<action>B<, const char *>I<tag>B<);>\n"
1320 msgstr ""
1321
1322 #. type: Plain text
1323 #: build/C/man3/fmtmsg.3:36
1324 msgid ""
1325 "This function displays a message described by its arguments on the device(s)  "
1326 "specified in the I<classification> argument.  For messages written to "
1327 "I<stderr>, the format depends on the B<MSGVERB> environment variable."
1328 msgstr ""
1329
1330 #. type: Plain text
1331 #: build/C/man3/fmtmsg.3:43
1332 msgid ""
1333 "The I<label> argument identifies the source of the message.  The string must "
1334 "consist of two colon separated parts where the first part has not more than "
1335 "10 and the second part not more than 14 characters."
1336 msgstr ""
1337
1338 #. type: Plain text
1339 #: build/C/man3/fmtmsg.3:47
1340 msgid "The I<text> argument describes the condition of the error."
1341 msgstr ""
1342
1343 #. type: Plain text
1344 #: build/C/man3/fmtmsg.3:52
1345 msgid ""
1346 "The I<action> argument describes possible steps to recover from the error.  "
1347 "If it is printed, it is prefixed by \"TO FIX: \"."
1348 msgstr ""
1349
1350 #. type: Plain text
1351 #: build/C/man3/fmtmsg.3:60
1352 msgid ""
1353 "The I<tag> argument is a reference to the online documentation where more "
1354 "information can be found.  It should contain the I<label> value and a unique "
1355 "identification number."
1356 msgstr ""
1357
1358 #. type: SS
1359 #: build/C/man3/fmtmsg.3:60
1360 #, no-wrap
1361 msgid "Dummy arguments"
1362 msgstr ""
1363
1364 #. type: Plain text
1365 #: build/C/man3/fmtmsg.3:79
1366 msgid ""
1367 "Each of the arguments can have a dummy value.  The dummy classification "
1368 "value B<MM_NULLMC> (0L) does not specify any output, so nothing is printed.  "
1369 "The dummy severity value B<NO_SEV> (0) says that no severity is supplied.  "
1370 "The values B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> are "
1371 "synonyms for I<((char *) 0)>, the empty string, and B<MM_NULLSEV> is a "
1372 "synonym for B<NO_SEV>."
1373 msgstr ""
1374
1375 #. type: SS
1376 #: build/C/man3/fmtmsg.3:79
1377 #, no-wrap
1378 msgid "The classification argument"
1379 msgstr ""
1380
1381 #. type: Plain text
1382 #: build/C/man3/fmtmsg.3:83
1383 msgid ""
1384 "The I<classification> argument is the sum of values describing 4 types of "
1385 "information."
1386 msgstr ""
1387
1388 #. type: Plain text
1389 #: build/C/man3/fmtmsg.3:86
1390 msgid "The first value defines the output channel."
1391 msgstr ""
1392
1393 #. type: TP
1394 #: build/C/man3/fmtmsg.3:86
1395 #, no-wrap
1396 msgid "B<MM_PRINT>"
1397 msgstr ""
1398
1399 #. type: Plain text
1400 #: build/C/man3/fmtmsg.3:90
1401 msgid "Output to I<stderr>."
1402 msgstr ""
1403
1404 #. type: TP
1405 #: build/C/man3/fmtmsg.3:90
1406 #, no-wrap
1407 msgid "B<MM_CONSOLE>"
1408 msgstr ""
1409
1410 #. type: Plain text
1411 #: build/C/man3/fmtmsg.3:93
1412 msgid "Output to the system console."
1413 msgstr ""
1414
1415 #. type: TP
1416 #: build/C/man3/fmtmsg.3:93
1417 #, no-wrap
1418 msgid "B<MM_PRINT | MM_CONSOLE>"
1419 msgstr ""
1420
1421 #. type: Plain text
1422 #: build/C/man3/fmtmsg.3:96
1423 msgid "Output to both."
1424 msgstr ""
1425
1426 #. type: Plain text
1427 #: build/C/man3/fmtmsg.3:98
1428 msgid "The second value is the source of the error:"
1429 msgstr ""
1430
1431 #. type: TP
1432 #: build/C/man3/fmtmsg.3:98
1433 #, no-wrap
1434 msgid "B<MM_HARD>"
1435 msgstr ""
1436
1437 #. type: Plain text
1438 #: build/C/man3/fmtmsg.3:101
1439 msgid "A hardware error occurred."
1440 msgstr ""
1441
1442 #. type: TP
1443 #: build/C/man3/fmtmsg.3:101
1444 #, no-wrap
1445 msgid "B<MM_FIRM>"
1446 msgstr ""
1447
1448 #. type: Plain text
1449 #: build/C/man3/fmtmsg.3:104
1450 msgid "A firmware error occurred."
1451 msgstr ""
1452
1453 #. type: TP
1454 #: build/C/man3/fmtmsg.3:104
1455 #, no-wrap
1456 msgid "B<MM_SOFT>"
1457 msgstr ""
1458
1459 #. type: Plain text
1460 #: build/C/man3/fmtmsg.3:107
1461 msgid "A software error occurred."
1462 msgstr ""
1463
1464 #. type: Plain text
1465 #: build/C/man3/fmtmsg.3:109
1466 msgid "The third value encodes the detector of the problem:"
1467 msgstr ""
1468
1469 #. type: TP
1470 #: build/C/man3/fmtmsg.3:109
1471 #, no-wrap
1472 msgid "B<MM_APPL>"
1473 msgstr ""
1474
1475 #. type: Plain text
1476 #: build/C/man3/fmtmsg.3:112
1477 msgid "It is detected by an application."
1478 msgstr ""
1479
1480 #. type: TP
1481 #: build/C/man3/fmtmsg.3:112
1482 #, no-wrap
1483 msgid "B<MM_UTIL>"
1484 msgstr ""
1485
1486 #. type: Plain text
1487 #: build/C/man3/fmtmsg.3:115
1488 msgid "It is detected by a utility."
1489 msgstr ""
1490
1491 #. type: TP
1492 #: build/C/man3/fmtmsg.3:115
1493 #, no-wrap
1494 msgid "B<MM_OPSYS>"
1495 msgstr ""
1496
1497 #. type: Plain text
1498 #: build/C/man3/fmtmsg.3:118
1499 msgid "It is detected by the operating system."
1500 msgstr ""
1501
1502 #. type: Plain text
1503 #: build/C/man3/fmtmsg.3:120
1504 msgid "The fourth value shows the severity of the incident:"
1505 msgstr ""
1506
1507 #. type: TP
1508 #: build/C/man3/fmtmsg.3:120
1509 #, no-wrap
1510 msgid "B<MM_RECOVER>"
1511 msgstr ""
1512
1513 #. type: Plain text
1514 #: build/C/man3/fmtmsg.3:123
1515 msgid "It is a recoverable error."
1516 msgstr ""
1517
1518 #. type: TP
1519 #: build/C/man3/fmtmsg.3:123
1520 #, no-wrap
1521 msgid "B<MM_NRECOV>"
1522 msgstr ""
1523
1524 #. type: Plain text
1525 #: build/C/man3/fmtmsg.3:126
1526 msgid "It is a nonrecoverable error."
1527 msgstr ""
1528
1529 #. type: SS
1530 #: build/C/man3/fmtmsg.3:126
1531 #, no-wrap
1532 msgid "The severity argument"
1533 msgstr ""
1534
1535 #. type: Plain text
1536 #: build/C/man3/fmtmsg.3:130
1537 msgid "The I<severity> argument can take one of the following values:"
1538 msgstr ""
1539
1540 #. type: TP
1541 #: build/C/man3/fmtmsg.3:130
1542 #, no-wrap
1543 msgid "B<MM_NOSEV>"
1544 msgstr ""
1545
1546 #. type: Plain text
1547 #: build/C/man3/fmtmsg.3:133
1548 msgid "No severity is printed."
1549 msgstr ""
1550
1551 #. type: TP
1552 #: build/C/man3/fmtmsg.3:133
1553 #, no-wrap
1554 msgid "B<MM_HALT>"
1555 msgstr ""
1556
1557 #. type: Plain text
1558 #: build/C/man3/fmtmsg.3:136
1559 msgid "This value is printed as HALT."
1560 msgstr ""
1561
1562 #. type: TP
1563 #: build/C/man3/fmtmsg.3:136
1564 #, no-wrap
1565 msgid "B<MM_ERROR>"
1566 msgstr ""
1567
1568 #. type: Plain text
1569 #: build/C/man3/fmtmsg.3:139
1570 msgid "This value is printed as ERROR."
1571 msgstr ""
1572
1573 #. type: TP
1574 #: build/C/man3/fmtmsg.3:139
1575 #, no-wrap
1576 msgid "B<MM_WARNING>"
1577 msgstr ""
1578
1579 #. type: Plain text
1580 #: build/C/man3/fmtmsg.3:142
1581 msgid "This value is printed as WARNING."
1582 msgstr ""
1583
1584 #. type: TP
1585 #: build/C/man3/fmtmsg.3:142
1586 #, no-wrap
1587 msgid "B<MM_INFO>"
1588 msgstr ""
1589
1590 #. type: Plain text
1591 #: build/C/man3/fmtmsg.3:145
1592 msgid "This value is printed as INFO."
1593 msgstr ""
1594
1595 #. type: Plain text
1596 #: build/C/man3/fmtmsg.3:152
1597 msgid ""
1598 "The numeric values are between 0 and 4.  Using B<addseverity>(3)  or the "
1599 "environment variable B<SEV_LEVEL> you can add more levels and strings to "
1600 "print."
1601 msgstr ""
1602
1603 #. type: Plain text
1604 #: build/C/man3/fmtmsg.3:154
1605 msgid "The function can return 4 values:"
1606 msgstr ""
1607
1608 #. type: TP
1609 #: build/C/man3/fmtmsg.3:154
1610 #, no-wrap
1611 msgid "B<MM_OK>"
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man3/fmtmsg.3:157
1616 msgid "Everything went smooth."
1617 msgstr ""
1618
1619 #. type: TP
1620 #: build/C/man3/fmtmsg.3:157
1621 #, no-wrap
1622 msgid "B<MM_NOTOK>"
1623 msgstr ""
1624
1625 #. type: Plain text
1626 #: build/C/man3/fmtmsg.3:160
1627 msgid "Complete failure."
1628 msgstr ""
1629
1630 #. type: TP
1631 #: build/C/man3/fmtmsg.3:160
1632 #, no-wrap
1633 msgid "B<MM_NOMSG>"
1634 msgstr ""
1635
1636 #. type: Plain text
1637 #: build/C/man3/fmtmsg.3:164
1638 msgid "Error writing to I<stderr>."
1639 msgstr ""
1640
1641 #. type: TP
1642 #: build/C/man3/fmtmsg.3:164
1643 #, no-wrap
1644 msgid "B<MM_NOCON>"
1645 msgstr ""
1646
1647 #. type: Plain text
1648 #: build/C/man3/fmtmsg.3:167
1649 msgid "Error writing to the console."
1650 msgstr ""
1651
1652 #. type: SH
1653 #: build/C/man3/fmtmsg.3:167
1654 #, no-wrap
1655 msgid "ENVIRONMENT"
1656 msgstr ""
1657
1658 #. type: Plain text
1659 #: build/C/man3/fmtmsg.3:178
1660 msgid ""
1661 "The environment variable B<MSGVERB> (\"message verbosity\") can be used to "
1662 "suppress parts of the output to I<stderr>.  (It does not influence output to "
1663 "the console.)  When this variable is defined, is non-NULL, and is a "
1664 "colon-separated list of valid keywords, then only the parts of the message "
1665 "corresponding to these keywords is printed.  Valid keywords are \"label\", "
1666 "\"severity\", \"text\", \"action\" and \"tag\"."
1667 msgstr ""
1668
1669 #. type: Plain text
1670 #: build/C/man3/fmtmsg.3:190
1671 msgid ""
1672 "The environment variable B<SEV_LEVEL> can be used to introduce new severity "
1673 "levels.  By default, only the five severity levels described above are "
1674 "available.  Any other numeric value would make B<fmtmsg>()  print nothing.  "
1675 "If the user puts B<SEV_LEVEL> with a format like"
1676 msgstr ""
1677
1678 #. type: Plain text
1679 #: build/C/man3/fmtmsg.3:193
1680 msgid "SEV_LEVEL=[description[:description[:...]]]"
1681 msgstr ""
1682
1683 #. type: Plain text
1684 #: build/C/man3/fmtmsg.3:198
1685 msgid ""
1686 "in the environment of the process before the first call to B<fmtmsg>(), "
1687 "where each description is of the form"
1688 msgstr ""
1689
1690 #. type: Plain text
1691 #: build/C/man3/fmtmsg.3:201
1692 msgid "severity-keyword,level,printstring"
1693 msgstr ""
1694
1695 #. type: Plain text
1696 #: build/C/man3/fmtmsg.3:208
1697 msgid ""
1698 "then B<fmtmsg>()  will also accept the indicated values for the level (in "
1699 "addition to the standard levels 0-4), and use the indicated printstring when "
1700 "such a level occurs."
1701 msgstr ""
1702
1703 #. type: Plain text
1704 #: build/C/man3/fmtmsg.3:222
1705 msgid ""
1706 "The severity-keyword part is not used by B<fmtmsg>()  but it has to be "
1707 "present.  The level part is a string representation of a number.  The "
1708 "numeric value must be a number greater than 4.  This value must be used in "
1709 "the severity argument of B<fmtmsg>()  to select this class.  It is not "
1710 "possible to overwrite any of the predefined classes.  The printstring is the "
1711 "string printed when a message of this class is processed by B<fmtmsg>()."
1712 msgstr ""
1713
1714 #. type: Plain text
1715 #: build/C/man3/fmtmsg.3:225
1716 msgid "B<fmtmsg>()  is provided in glibc since version 2.1."
1717 msgstr ""
1718
1719 #. type: Plain text
1720 #: build/C/man3/fmtmsg.3:240
1721 msgid ""
1722 "The functions B<fmtmsg>()  and B<addseverity>(3), and environment variables "
1723 "B<MSGVERB> and B<SEV_LEVEL> come from System V.  The function B<fmtmsg>()  "
1724 "and the environment variable B<MSGVERB> are described in POSIX.1-2001."
1725 msgstr ""
1726
1727 #. type: Plain text
1728 #: build/C/man3/fmtmsg.3:244
1729 msgid ""
1730 "System V and UnixWare man pages tell us that these functions have been "
1731 "replaced by \"pfmt() and addsev()\" or by \"pfmt(), vpfmt(), lfmt(), and "
1732 "vlfmt()\", and will be removed later."
1733 msgstr ""
1734
1735 #. type: Plain text
1736 #: build/C/man3/fmtmsg.3:249
1737 #, no-wrap
1738 msgid ""
1739 "#include E<lt>stdio.hE<gt>\n"
1740 "#include E<lt>stdlib.hE<gt>\n"
1741 "#include E<lt>fmtmsg.hE<gt>\n"
1742 msgstr ""
1743
1744 #. type: Plain text
1745 #: build/C/man3/fmtmsg.3:255
1746 #, no-wrap
1747 msgid ""
1748 "int\n"
1749 "main(void)\n"
1750 "{\n"
1751 "    long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
1752 "    int err;\n"
1753 msgstr ""
1754
1755 #. type: Plain text
1756 #: build/C/man3/fmtmsg.3:276
1757 #, no-wrap
1758 msgid ""
1759 "    err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
1760 "                \"unknown mount option\", \"See mount(8).\",\n"
1761 "                \"util-linux:mount:017\");\n"
1762 "    switch (err) {\n"
1763 "    case MM_OK:\n"
1764 "        break;\n"
1765 "    case MM_NOTOK:\n"
1766 "        printf(\"Nothing printed\\en\");\n"
1767 "        break;\n"
1768 "    case MM_NOMSG:\n"
1769 "        printf(\"Nothing printed to stderr\\en\");\n"
1770 "        break;\n"
1771 "    case MM_NOCON:\n"
1772 "        printf(\"No console output\\en\");\n"
1773 "        break;\n"
1774 "    default:\n"
1775 "        printf(\"Unknown error from fmtmsg()\\en\");\n"
1776 "    }\n"
1777 "    exit(EXIT_SUCCESS);\n"
1778 "}\n"
1779 msgstr ""
1780
1781 #. type: Plain text
1782 #: build/C/man3/fmtmsg.3:279
1783 msgid "The output should be:"
1784 msgstr ""
1785
1786 #. type: Plain text
1787 #: build/C/man3/fmtmsg.3:283
1788 #, no-wrap
1789 msgid ""
1790 "    util-linux:mount: ERROR: unknown mount option\n"
1791 "    TO FIX: See mount(8).  util-linux:mount:017\n"
1792 msgstr ""
1793
1794 #. type: Plain text
1795 #: build/C/man3/fmtmsg.3:286
1796 msgid "and after"
1797 msgstr ""
1798
1799 #. type: Plain text
1800 #: build/C/man3/fmtmsg.3:289
1801 #, no-wrap
1802 msgid "    MSGVERB=text:action; export MSGVERB\n"
1803 msgstr ""
1804
1805 #. type: Plain text
1806 #: build/C/man3/fmtmsg.3:292
1807 msgid "the output becomes:"
1808 msgstr ""
1809
1810 #. type: Plain text
1811 #: build/C/man3/fmtmsg.3:296
1812 #, no-wrap
1813 msgid ""
1814 "    unknown mount option\n"
1815 "    TO FIX: See mount(8).\n"
1816 msgstr ""
1817
1818 #. type: Plain text
1819 #: build/C/man3/fmtmsg.3:300
1820 msgid "B<addseverity>(3), B<perror>(3)"
1821 msgstr ""
1822
1823 #. type: TH
1824 #: build/C/man3/fopen.3:44
1825 #, no-wrap
1826 msgid "FOPEN"
1827 msgstr ""
1828
1829 #. type: TH
1830 #: build/C/man3/fopen.3:44
1831 #, no-wrap
1832 msgid "2012-04-22"
1833 msgstr ""
1834
1835 #. type: Plain text
1836 #: build/C/man3/fopen.3:47
1837 msgid "fopen, fdopen, freopen - stream open functions"
1838 msgstr ""
1839
1840 #. type: Plain text
1841 #: build/C/man3/fopen.3:52
1842 #, no-wrap
1843 msgid "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
1844 msgstr ""
1845
1846 #. type: Plain text
1847 #: build/C/man3/fopen.3:54
1848 #, no-wrap
1849 msgid "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
1850 msgstr ""
1851
1852 #. type: Plain text
1853 #: build/C/man3/fopen.3:56
1854 #, no-wrap
1855 msgid ""
1856 "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE "
1857 "*>I<stream>B<);>\n"
1858 msgstr ""
1859
1860 #. type: Plain text
1861 #: build/C/man3/fopen.3:65
1862 msgid "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1863 msgstr ""
1864
1865 #. type: Plain text
1866 #: build/C/man3/fopen.3:71
1867 msgid ""
1868 "The B<fopen>()  function opens the file whose name is the string pointed to "
1869 "by I<path> and associates a stream with it."
1870 msgstr ""
1871
1872 #. type: Plain text
1873 #: build/C/man3/fopen.3:76
1874 msgid ""
1875 "The argument I<mode> points to a string beginning with one of the following "
1876 "sequences (possibly followed by additional characters, as described below):"
1877 msgstr ""
1878
1879 #. type: TP
1880 #: build/C/man3/fopen.3:76
1881 #, no-wrap
1882 msgid "B<r>"
1883 msgstr ""
1884
1885 #. type: Plain text
1886 #: build/C/man3/fopen.3:80
1887 msgid ""
1888 "Open text file for reading.  The stream is positioned at the beginning of "
1889 "the file."
1890 msgstr ""
1891
1892 #. type: TP
1893 #: build/C/man3/fopen.3:80
1894 #, no-wrap
1895 msgid "B<r+>"
1896 msgstr ""
1897
1898 #. type: Plain text
1899 #: build/C/man3/fopen.3:84
1900 msgid ""
1901 "Open for reading and writing.  The stream is positioned at the beginning of "
1902 "the file."
1903 msgstr ""
1904
1905 #. type: TP
1906 #: build/C/man3/fopen.3:84
1907 #, no-wrap
1908 msgid "B<w>"
1909 msgstr ""
1910
1911 #. type: Plain text
1912 #: build/C/man3/fopen.3:88
1913 msgid ""
1914 "Truncate file to zero length or create text file for writing.  The stream is "
1915 "positioned at the beginning of the file."
1916 msgstr ""
1917
1918 #. type: TP
1919 #: build/C/man3/fopen.3:88
1920 #, no-wrap
1921 msgid "B<w+>"
1922 msgstr ""
1923
1924 #. type: Plain text
1925 #: build/C/man3/fopen.3:94
1926 msgid ""
1927 "Open for reading and writing.  The file is created if it does not exist, "
1928 "otherwise it is truncated.  The stream is positioned at the beginning of the "
1929 "file."
1930 msgstr ""
1931
1932 #. type: TP
1933 #: build/C/man3/fopen.3:94 build/C/man3/scanf.3:447
1934 #, no-wrap
1935 msgid "B<a>"
1936 msgstr ""
1937
1938 #. type: Plain text
1939 #: build/C/man3/fopen.3:99
1940 msgid ""
1941 "Open for appending (writing at end of file).  The file is created if it does "
1942 "not exist.  The stream is positioned at the end of the file."
1943 msgstr ""
1944
1945 #. type: TP
1946 #: build/C/man3/fopen.3:99
1947 #, no-wrap
1948 msgid "B<a+>"
1949 msgstr ""
1950
1951 #. type: Plain text
1952 #: build/C/man3/fopen.3:105
1953 msgid ""
1954 "Open for reading and appending (writing at end of file).  The file is "
1955 "created if it does not exist.  The initial file position for reading is at "
1956 "the beginning of the file, but output is always appended to the end of the "
1957 "file."
1958 msgstr ""
1959
1960 #. type: Plain text
1961 #: build/C/man3/fopen.3:118
1962 msgid ""
1963 "The I<mode> string can also include the letter \\(aqb\\(aq either as a last "
1964 "character or as a character between the characters in any of the "
1965 "two-character strings described above.  This is strictly for compatibility "
1966 "with C89 and has no effect; the \\(aqb\\(aq is ignored on all POSIX "
1967 "conforming systems, including Linux.  (Other systems may treat text files "
1968 "and binary files differently, and adding the \\(aqb\\(aq may be a good idea "
1969 "if you do I/O to a binary file and expect that your program may be ported to "
1970 "non-UNIX environments.)"
1971 msgstr ""
1972
1973 #. type: Plain text
1974 #: build/C/man3/fopen.3:121
1975 msgid "See NOTES below for details of glibc extensions for I<mode>."
1976 msgstr ""
1977
1978 #. type: Plain text
1979 #: build/C/man3/fopen.3:126
1980 msgid ""
1981 "Any created files will have mode B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
1982 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666), as modified by the process's "
1983 "umask value (see B<umask>(2))."
1984 msgstr ""
1985
1986 #. type: Plain text
1987 #: build/C/man3/fopen.3:141
1988 msgid ""
1989 "Reads and writes may be intermixed on read/write streams in any order.  Note "
1990 "that ANSI C requires that a file positioning function intervene between "
1991 "output and input, unless an input operation encounters end-of-file.  (If "
1992 "this condition is not met, then a read is allowed to return the result of "
1993 "writes other than the most recent.)  Therefore it is good practice (and "
1994 "indeed sometimes necessary under Linux) to put an B<fseek>(3)  or "
1995 "B<fgetpos>(3)  operation between write and read operations on such a "
1996 "stream.  This operation may be an apparent no-op (as in I<fseek(..., 0L, "
1997 "SEEK_CUR)> called for its synchronizing side effect."
1998 msgstr ""
1999
2000 #. type: Plain text
2001 #: build/C/man3/fopen.3:146
2002 msgid ""
2003 "Opening a file in append mode (B<a> as the first character of I<mode>)  "
2004 "causes all subsequent write operations to this stream to occur at "
2005 "end-of-file, as if preceded the call:"
2006 msgstr ""
2007
2008 #. type: Plain text
2009 #: build/C/man3/fopen.3:149
2010 #, no-wrap
2011 msgid "    fseek(stream, 0, SEEK_END);\n"
2012 msgstr ""
2013
2014 #. type: Plain text
2015 #: build/C/man3/fopen.3:171
2016 msgid ""
2017 "The B<fdopen>()  function associates a stream with the existing file "
2018 "descriptor, I<fd>.  The I<mode> of the stream (one of the values \"r\", "
2019 "\"r+\", \"w\", \"w+\", \"a\", \"a+\")  must be compatible with the mode of "
2020 "the file descriptor.  The file position indicator of the new stream is set "
2021 "to that belonging to I<fd>, and the error and end-of-file indicators are "
2022 "cleared.  Modes \"w\" or \"w+\" do not cause truncation of the file.  The "
2023 "file descriptor is not dup'ed, and will be closed when the stream created by "
2024 "B<fdopen>()  is closed.  The result of applying B<fdopen>()  to a shared "
2025 "memory object is undefined."
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man3/fopen.3:189
2030 msgid ""
2031 "The B<freopen>()  function opens the file whose name is the string pointed "
2032 "to by I<path> and associates the stream pointed to by I<stream> with it.  "
2033 "The original stream (if it exists) is closed.  The I<mode> argument is used "
2034 "just as in the B<fopen>()  function.  The primary use of the B<freopen>()  "
2035 "function is to change the file associated with a standard text stream "
2036 "(I<stderr>, I<stdin>, or I<stdout>)."
2037 msgstr ""
2038
2039 #. type: Plain text
2040 #: build/C/man3/fopen.3:201
2041 msgid ""
2042 "Upon successful completion B<fopen>(), B<fdopen>()  and B<freopen>()  return "
2043 "a I<FILE> pointer.  Otherwise, NULL is returned and I<errno> is set to "
2044 "indicate the error."
2045 msgstr ""
2046
2047 #. type: TP
2048 #: build/C/man3/fopen.3:202 build/C/man3/fseek.3:142 build/C/man3/getline.3:123 build/C/man2/llseek.2:77 build/C/man2/lseek.2:166 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:566 build/C/man2/write.2:154
2049 #, no-wrap
2050 msgid "B<EINVAL>"
2051 msgstr ""
2052
2053 #. type: Plain text
2054 #: build/C/man3/fopen.3:212
2055 msgid ""
2056 "The I<mode> provided to B<fopen>(), B<fdopen>(), or B<freopen>()  was "
2057 "invalid."
2058 msgstr ""
2059
2060 #. type: Plain text
2061 #: build/C/man3/fopen.3:222
2062 msgid ""
2063 "The B<fopen>(), B<fdopen>()  and B<freopen>()  functions may also fail and "
2064 "set I<errno> for any of the errors specified for the routine B<malloc>(3)."
2065 msgstr ""
2066
2067 #. type: Plain text
2068 #: build/C/man3/fopen.3:229
2069 msgid ""
2070 "The B<fopen>()  function may also fail and set I<errno> for any of the "
2071 "errors specified for the routine B<open>(2)."
2072 msgstr ""
2073
2074 #. type: Plain text
2075 #: build/C/man3/fopen.3:236
2076 msgid ""
2077 "The B<fdopen>()  function may also fail and set I<errno> for any of the "
2078 "errors specified for the routine B<fcntl>(2)."
2079 msgstr ""
2080
2081 #. type: Plain text
2082 #: build/C/man3/fopen.3:246
2083 msgid ""
2084 "The B<freopen>()  function may also fail and set I<errno> for any of the "
2085 "errors specified for the routines B<open>(2), B<fclose>(3)  and "
2086 "B<fflush>(3)."
2087 msgstr ""
2088
2089 #. type: Plain text
2090 #: build/C/man3/fopen.3:255
2091 msgid ""
2092 "The B<fopen>()  and B<freopen>()  functions conform to C89.  The B<fdopen>()  "
2093 "function conforms to POSIX.1-1990."
2094 msgstr ""
2095
2096 #. type: SS
2097 #: build/C/man3/fopen.3:256
2098 #, no-wrap
2099 msgid "Glibc notes"
2100 msgstr ""
2101
2102 #. type: Plain text
2103 #: build/C/man3/fopen.3:259
2104 msgid ""
2105 "The GNU C library allows the following extensions for the string specified "
2106 "in I<mode>:"
2107 msgstr ""
2108
2109 #. type: TP
2110 #: build/C/man3/fopen.3:259
2111 #, no-wrap
2112 msgid "B<c> (since glibc 2.3.3)"
2113 msgstr ""
2114
2115 #. type: Plain text
2116 #: build/C/man3/fopen.3:266
2117 msgid ""
2118 "Do not make the open operation, or subsequent read and write operations, "
2119 "thread cancellation points.  This flag is ignored for B<fdopen>()."
2120 msgstr ""
2121
2122 #. type: TP
2123 #: build/C/man3/fopen.3:266
2124 #, no-wrap
2125 msgid "B<e> (since glibc 2.7)"
2126 msgstr ""
2127
2128 #. type: Plain text
2129 #: build/C/man3/fopen.3:276
2130 msgid ""
2131 "Open the file with the B<O_CLOEXEC> flag.  See B<open>(2)  for more "
2132 "information.  This flag is ignored for B<fdopen>()."
2133 msgstr ""
2134
2135 #. type: TP
2136 #: build/C/man3/fopen.3:276
2137 #, no-wrap
2138 msgid "B<m> (since glibc 2.3)"
2139 msgstr ""
2140
2141 #.  As at glibc 2.4:
2142 #. type: Plain text
2143 #: build/C/man3/fopen.3:288
2144 msgid ""
2145 "Attempt to access the file using B<mmap>(2), rather than I/O system calls "
2146 "(B<read>(2), B<write>(2)).  Currently, use of B<mmap>(2)  is only attempted "
2147 "for a file opened for reading."
2148 msgstr ""
2149
2150 #. type: TP
2151 #: build/C/man3/fopen.3:288 build/C/man3/scanf.3:421
2152 #, no-wrap
2153 msgid "B<x>"
2154 msgstr ""
2155
2156 #.  Since glibc 2.0?
2157 #.  FIXME C11 specifies this flag
2158 #. type: Plain text
2159 #: build/C/man3/fopen.3:305
2160 msgid ""
2161 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)).  If the "
2162 "file already exists, B<fopen>()  fails, and sets I<errno> to B<EEXIST>.  "
2163 "This flag is ignored for B<fdopen>()."
2164 msgstr ""
2165
2166 #. type: Plain text
2167 #: build/C/man3/fopen.3:313
2168 msgid ""
2169 "In addition to the above characters, B<fopen>()  and B<freopen>()  support "
2170 "the following syntax in I<mode>:"
2171 msgstr ""
2172
2173 #. type: Plain text
2174 #: build/C/man3/fopen.3:315
2175 msgid "B< ,ccs=>I<string>"
2176 msgstr ""
2177
2178 #. type: Plain text
2179 #: build/C/man3/fopen.3:331
2180 msgid ""
2181 "The given I<string> is taken as the name of a coded character set and the "
2182 "stream is marked as wide-oriented.  Thereafter, internal conversion "
2183 "functions convert I/O to and from the character set I<string>.  If the "
2184 "B<,ccs=>I<string> syntax is not specified, then the wide-orientation of the "
2185 "stream is determined by the first file operation.  If that operation is a "
2186 "wide-character operation, the stream is marked wide-oriented, and functions "
2187 "to convert to the coded character set are loaded."
2188 msgstr ""
2189
2190 #.  FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12685
2191 #. type: Plain text
2192 #: build/C/man3/fopen.3:348
2193 msgid ""
2194 "When parsing for individual flag characters in I<mode> (i.e., the characters "
2195 "preceding the \"ccs\" specification), the glibc implementation of B<fopen>()  "
2196 "and B<freopen>()  limits the number of characters examined in I<mode> to 7 "
2197 "(or, in glibc versions before 2.14, to 6, which was not enough to include "
2198 "possible specifications such as \"rb+cmxe\").  The current implementation of "
2199 "B<fdopen>()  parses at most 5 characters in I<mode>."
2200 msgstr ""
2201
2202 #. type: Plain text
2203 #: build/C/man3/fopen.3:354
2204 msgid "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
2205 msgstr ""
2206
2207 #. type: TH
2208 #: build/C/man3/fopencookie.3:26
2209 #, no-wrap
2210 msgid "FOPENCOOKIE"
2211 msgstr ""
2212
2213 #. type: TH
2214 #: build/C/man3/fopencookie.3:26
2215 #, no-wrap
2216 msgid "2012-04-30"
2217 msgstr ""
2218
2219 #. type: TH
2220 #: 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:52 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
2221 #, no-wrap
2222 msgid "Linux"
2223 msgstr ""
2224
2225 #. type: Plain text
2226 #: build/C/man3/fopencookie.3:29
2227 msgid "fopencookie - opening a custom stream"
2228 msgstr ""
2229
2230 #. type: Plain text
2231 #: build/C/man3/fopencookie.3:36
2232 #, no-wrap
2233 msgid ""
2234 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
2235 "B<                  cookie_io_functions_t >I<io_funcs>B<);>\n"
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man3/fopencookie.3:49
2240 msgid ""
2241 "The B<fopencookie>()  function allows the programmer to create a custom "
2242 "implementation for a standard I/O stream.  This implementation can store the "
2243 "stream's data at a location of its own choosing; for example, "
2244 "B<fopencookie>()  is used to implement B<fmemopen>(3), which provides a "
2245 "stream interface to data that is stored in a buffer in memory."
2246 msgstr ""
2247
2248 #. type: Plain text
2249 #: build/C/man3/fopencookie.3:51
2250 msgid "In order to create a custom stream the programmer must:"
2251 msgstr ""
2252
2253 #. type: IP
2254 #: build/C/man3/fopencookie.3:51 build/C/man3/fopencookie.3:54 build/C/man3/fopencookie.3:65 build/C/man3/scanf.3:634 build/C/man3/scanf.3:639 build/C/man3/scanf.3:645 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
2255 #, no-wrap
2256 msgid "*"
2257 msgstr ""
2258
2259 #. type: Plain text
2260 #: build/C/man3/fopencookie.3:54
2261 msgid ""
2262 "Implement four \"hook\" functions that are used internally by the standard "
2263 "I/O library when performing I/O on the stream."
2264 msgstr ""
2265
2266 #. type: Plain text
2267 #: build/C/man3/fopencookie.3:65
2268 msgid ""
2269 "Define a \"cookie\" data type, a structure that provides bookkeeping "
2270 "information (e.g., where to store data) used by the aforementioned hook "
2271 "functions.  The standard I/O package knows nothing about the contents of "
2272 "this cookie (thus it is typed as I<void\\ *> when passed to "
2273 "B<fopencookie>()), but automatically supplies the cookie as the first "
2274 "argument when calling the hook functions."
2275 msgstr ""
2276
2277 #. type: Plain text
2278 #: build/C/man3/fopencookie.3:70
2279 msgid ""
2280 "Call B<fopencookie>()  to open a new stream and associate the cookie and "
2281 "hook functions with that stream."
2282 msgstr ""
2283
2284 #. type: Plain text
2285 #: build/C/man3/fopencookie.3:78
2286 msgid ""
2287 "The B<fopencookie>()  function serves a purpose similar to B<fopen>(3): it "
2288 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
2289 "operate on that stream."
2290 msgstr ""
2291
2292 #. type: Plain text
2293 #: build/C/man3/fopencookie.3:85
2294 msgid ""
2295 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
2296 "to be associated with the new stream.  This pointer is supplied as the first "
2297 "argument when the standard I/O library invokes any of the hook functions "
2298 "described below."
2299 msgstr ""
2300
2301 #. type: Plain text
2302 #: build/C/man3/fopencookie.3:101
2303 msgid ""
2304 "The I<mode> argument serves the same purpose as for B<fopen>(3).  The "
2305 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>.  "
2306 "See B<fopen>(3)  for details."
2307 msgstr ""
2308
2309 #. type: Plain text
2310 #: build/C/man3/fopencookie.3:107
2311 msgid ""
2312 "The I<io_funcs> argument is a structure that contains four fields pointing "
2313 "to the programmer-defined hook functions that are used to implement this "
2314 "stream.  The structure is defined as follows"
2315 msgstr ""
2316
2317 #. type: Plain text
2318 #: build/C/man3/fopencookie.3:116
2319 #, no-wrap
2320 msgid ""
2321 "struct cookie_io_functions_t {\n"
2322 "    cookie_read_function_t  *read;\n"
2323 "    cookie_write_function_t *write;\n"
2324 "    cookie_seek_function_t  *seek;\n"
2325 "    cookie_close_function_t *close;\n"
2326 "};\n"
2327 msgstr ""
2328
2329 #. type: Plain text
2330 #: build/C/man3/fopencookie.3:120
2331 msgid "The four fields are as follows:"
2332 msgstr ""
2333
2334 #. type: TP
2335 #: build/C/man3/fopencookie.3:120
2336 #, no-wrap
2337 msgid "I<cookie_read_function_t *read>"
2338 msgstr ""
2339
2340 #. type: Plain text
2341 #: build/C/man3/fopencookie.3:124
2342 msgid ""
2343 "This function implements read operations for the stream.  When called, it "
2344 "receives three arguments:"
2345 msgstr ""
2346
2347 #. type: Plain text
2348 #: build/C/man3/fopencookie.3:126
2349 #, no-wrap
2350 msgid "    ssize_t read(void *cookie, char *buf, size_t size);\n"
2351 msgstr ""
2352
2353 #. type: Plain text
2354 #: build/C/man3/fopencookie.3:141
2355 msgid ""
2356 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
2357 "input data can be placed and the size of that buffer.  As its function "
2358 "result, the I<read> function should return the number of bytes copied into "
2359 "I<buf>, 0 on end of file, or -1 on error.  The I<read> function should "
2360 "update the stream offset appropriately."
2361 msgstr ""
2362
2363 #. type: Plain text
2364 #: build/C/man3/fopencookie.3:146
2365 msgid ""
2366 "If I<*read> is a NULL pointer, then reads from the custom stream always "
2367 "return end of file."
2368 msgstr ""
2369
2370 #. type: TP
2371 #: build/C/man3/fopencookie.3:146
2372 #, no-wrap
2373 msgid "I<cookie_write_function_t *write>"
2374 msgstr ""
2375
2376 #. type: Plain text
2377 #: build/C/man3/fopencookie.3:150
2378 msgid ""
2379 "This function implements write operations for the stream.  When called, it "
2380 "receives three arguments:"
2381 msgstr ""
2382
2383 #. type: Plain text
2384 #: build/C/man3/fopencookie.3:152
2385 #, no-wrap
2386 msgid "    ssize_t write(void *cookie, const char *buf, size_t size);\n"
2387 msgstr ""
2388
2389 #. type: Plain text
2390 #: build/C/man3/fopencookie.3:168
2391 msgid ""
2392 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
2393 "output to the stream and the size of that buffer.  As its function result, "
2394 "the I<write> function should return the number of bytes copied from I<buf>, "
2395 "or 0 on error.  (The function must not return a negative value.)  The "
2396 "I<write> function should update the stream offset appropriately."
2397 msgstr ""
2398
2399 #. type: Plain text
2400 #: build/C/man3/fopencookie.3:173
2401 msgid "If I<*write> is a NULL pointer, then output to the stream is discarded."
2402 msgstr ""
2403
2404 #. type: TP
2405 #: build/C/man3/fopencookie.3:173
2406 #, no-wrap
2407 msgid "I<cookie_seek_function_t *seek>"
2408 msgstr ""
2409
2410 #. type: Plain text
2411 #: build/C/man3/fopencookie.3:177
2412 msgid ""
2413 "This function implements seek operations on the stream.  When called, it "
2414 "receives three arguments:"
2415 msgstr ""
2416
2417 #. type: Plain text
2418 #: build/C/man3/fopencookie.3:179
2419 #, no-wrap
2420 msgid "    int seek(void *cookie, off64_t *offset, int whence);\n"
2421 msgstr ""
2422
2423 #. type: Plain text
2424 #: build/C/man3/fopencookie.3:185
2425 msgid ""
2426 "The I<*offset> argument specifies the new file offset depending on which of "
2427 "the following three values is supplied in I<whence>:"
2428 msgstr ""
2429
2430 #. type: TP
2431 #: build/C/man3/fopencookie.3:186 build/C/man2/lseek.2:67
2432 #, no-wrap
2433 msgid "B<SEEK_SET>"
2434 msgstr ""
2435
2436 #. type: Plain text
2437 #: build/C/man3/fopencookie.3:191
2438 msgid ""
2439 "The stream offset should be set I<*offset> bytes from the start of the "
2440 "stream."
2441 msgstr ""
2442
2443 #. type: TP
2444 #: build/C/man3/fopencookie.3:191 build/C/man2/lseek.2:72
2445 #, no-wrap
2446 msgid "B<SEEK_CUR>"
2447 msgstr ""
2448
2449 #. type: Plain text
2450 #: build/C/man3/fopencookie.3:195
2451 msgid "I<*offset> should be added to the current stream offset."
2452 msgstr ""
2453
2454 #. type: TP
2455 #: build/C/man3/fopencookie.3:195 build/C/man2/lseek.2:77
2456 #, no-wrap
2457 msgid "B<SEEK_END>"
2458 msgstr ""
2459
2460 #. type: Plain text
2461 #: build/C/man3/fopencookie.3:199
2462 msgid "The stream offset should be set to the size of the stream plus I<*offset>."
2463 msgstr ""
2464
2465 #. type: Plain text
2466 #: build/C/man3/fopencookie.3:206
2467 msgid ""
2468 "Before returning, the I<seek> function should update I<*offset> to indicate "
2469 "the new stream offset."
2470 msgstr ""
2471
2472 #. type: Plain text
2473 #: build/C/man3/fopencookie.3:210
2474 msgid ""
2475 "As its function result, the I<seek> function should return 0 on success, and "
2476 "-1 on error."
2477 msgstr ""
2478
2479 #. type: Plain text
2480 #: build/C/man3/fopencookie.3:215
2481 msgid ""
2482 "If I<*seek> is a NULL pointer, then it is not possible to perform seek "
2483 "operations on the stream."
2484 msgstr ""
2485
2486 #. type: TP
2487 #: build/C/man3/fopencookie.3:215
2488 #, no-wrap
2489 msgid "I<cookie_close_function_t *close>"
2490 msgstr ""
2491
2492 #. type: Plain text
2493 #: build/C/man3/fopencookie.3:221
2494 msgid ""
2495 "This function closes the stream.  The hook function can do things such as "
2496 "freeing buffers allocated for the stream.  When called, it receives one "
2497 "argument:"
2498 msgstr ""
2499
2500 #. type: Plain text
2501 #: build/C/man3/fopencookie.3:223
2502 #, no-wrap
2503 msgid "    int close(void *cookie);\n"
2504 msgstr ""
2505
2506 #. type: Plain text
2507 #: build/C/man3/fopencookie.3:228
2508 msgid ""
2509 "The I<cookie> argument is the cookie that the programmer supplied when "
2510 "calling B<fopencookie>()."
2511 msgstr ""
2512
2513 #. type: Plain text
2514 #: build/C/man3/fopencookie.3:234
2515 msgid ""
2516 "As its function result, the I<close> function should return 0 on success, "
2517 "and B<EOF> on error."
2518 msgstr ""
2519
2520 #. type: Plain text
2521 #: build/C/man3/fopencookie.3:238
2522 msgid ""
2523 "If I<*close> is NULL, then no special action is performed when the stream is "
2524 "closed."
2525 msgstr ""
2526
2527 #.  .SH ERRORS
2528 #.  It's not clear if errno ever gets set...
2529 #. type: Plain text
2530 #: build/C/man3/fopencookie.3:245
2531 msgid ""
2532 "On success B<fopencookie>()  returns a pointer to the new stream.  On error, "
2533 "NULL is returned."
2534 msgstr ""
2535
2536 #. type: Plain text
2537 #: build/C/man3/fopencookie.3:247
2538 msgid "This function is a nonstandard GNU extension."
2539 msgstr ""
2540
2541 #. type: Plain text
2542 #: build/C/man3/fopencookie.3:256
2543 msgid ""
2544 "The program below implements a custom stream whose functionality is similar "
2545 "(but not identical) to that available via B<fmemopen>(3).  It implements a "
2546 "stream whose data is stored in a memory buffer.  The program writes its "
2547 "command-line arguments to the stream, and then seeks through the stream "
2548 "reading two out of every five characters and writing them to standard "
2549 "output.  The following shell session demonstrates the use of the program:"
2550 msgstr ""
2551
2552 #. type: Plain text
2553 #: build/C/man3/fopencookie.3:264
2554 #, no-wrap
2555 msgid ""
2556 "$B< ./a.out \\(aqhello world\\(aq>\n"
2557 "/he/\n"
2558 "/ w/\n"
2559 "/d/\n"
2560 "Reached end of file\n"
2561 msgstr ""
2562
2563 #. type: Plain text
2564 #: build/C/man3/fopencookie.3:271
2565 msgid ""
2566 "Note that a more general version of the program below could be improved to "
2567 "more robustly handle various error situations (e.g., opening a stream with a "
2568 "cookie that already has an open stream; closing a stream that has already "
2569 "been closed)."
2570 msgstr ""
2571
2572 #. type: Plain text
2573 #: build/C/man3/fopencookie.3:280
2574 #, no-wrap
2575 msgid ""
2576 "#define _GNU_SOURCE\n"
2577 "#include E<lt>sys/types.hE<gt>\n"
2578 "#include E<lt>stdio.hE<gt>\n"
2579 "#include E<lt>stdlib.hE<gt>\n"
2580 "#include E<lt>unistd.hE<gt>\n"
2581 "#include E<lt>string.hE<gt>\n"
2582 msgstr ""
2583
2584 #. type: Plain text
2585 #: build/C/man3/fopencookie.3:282
2586 #, no-wrap
2587 msgid "#define INIT_BUF_SIZE 4\n"
2588 msgstr ""
2589
2590 #. type: Plain text
2591 #: build/C/man3/fopencookie.3:289
2592 #, no-wrap
2593 msgid ""
2594 "struct memfile_cookie {\n"
2595 "    char   *buf;        /* Dynamically sized buffer for data */\n"
2596 "    size_t  allocated;  /* Size of buf */\n"
2597 "    size_t  endpos;     /* Number of characters in buf */\n"
2598 "    off_t   offset;     /* Current file offset in buf */\n"
2599 "};\n"
2600 msgstr ""
2601
2602 #. type: Plain text
2603 #: build/C/man3/fopencookie.3:295
2604 #, no-wrap
2605 msgid ""
2606 "ssize_t\n"
2607 "memfile_write(void *c, const char *buf, size_t size)\n"
2608 "{\n"
2609 "    char *new_buff;\n"
2610 "    struct memfile_cookie *cookie = c;\n"
2611 msgstr ""
2612
2613 #. type: Plain text
2614 #: build/C/man3/fopencookie.3:297
2615 #, no-wrap
2616 msgid "    /* Buffer too small? Keep doubling size until big enough */\n"
2617 msgstr ""
2618
2619 #. type: Plain text
2620 #: build/C/man3/fopencookie.3:307
2621 #, no-wrap
2622 msgid ""
2623 "    while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
2624 "        new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
2625 "        if (new_buff == NULL) {\n"
2626 "            return -1;\n"
2627 "        } else {\n"
2628 "            cookie-E<gt>allocated *= 2;\n"
2629 "            cookie-E<gt>buf = new_buff;\n"
2630 "        }\n"
2631 "    }\n"
2632 msgstr ""
2633
2634 #. type: Plain text
2635 #: build/C/man3/fopencookie.3:309
2636 #, no-wrap
2637 msgid "    memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
2638 msgstr ""
2639
2640 #. type: Plain text
2641 #: build/C/man3/fopencookie.3:313
2642 #, no-wrap
2643 msgid ""
2644 "    cookie-E<gt>offset += size;\n"
2645 "    if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
2646 "        cookie-E<gt>endpos = cookie-E<gt>offset;\n"
2647 msgstr ""
2648
2649 #. type: Plain text
2650 #: build/C/man3/fopencookie.3:316
2651 #, no-wrap
2652 msgid ""
2653 "    return size;\n"
2654 "}\n"
2655 msgstr ""
2656
2657 #. type: Plain text
2658 #: build/C/man3/fopencookie.3:322
2659 #, no-wrap
2660 msgid ""
2661 "ssize_t\n"
2662 "memfile_read(void *c, char *buf, size_t size)\n"
2663 "{\n"
2664 "    ssize_t xbytes;\n"
2665 "    struct memfile_cookie *cookie = c;\n"
2666 msgstr ""
2667
2668 #. type: Plain text
2669 #: build/C/man3/fopencookie.3:324
2670 #, no-wrap
2671 msgid "    /* Fetch minimum of bytes requested and bytes available */\n"
2672 msgstr ""
2673
2674 #. type: Plain text
2675 #: build/C/man3/fopencookie.3:330
2676 #, no-wrap
2677 msgid ""
2678 "    xbytes = size;\n"
2679 "    if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
2680 "        xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
2681 "    if (xbytes E<lt> 0)     /* offset may be past endpos */\n"
2682 "       xbytes = 0;\n"
2683 msgstr ""
2684
2685 #. type: Plain text
2686 #: build/C/man3/fopencookie.3:332
2687 #, no-wrap
2688 msgid "    memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
2689 msgstr ""
2690
2691 #. type: Plain text
2692 #: build/C/man3/fopencookie.3:336
2693 #, no-wrap
2694 msgid ""
2695 "    cookie-E<gt>offset += xbytes;\n"
2696 "    return xbytes;\n"
2697 "}\n"
2698 msgstr ""
2699
2700 #. type: Plain text
2701 #: build/C/man3/fopencookie.3:342
2702 #, no-wrap
2703 msgid ""
2704 "int\n"
2705 "memfile_seek(void *c, off64_t *offset, int whence)\n"
2706 "{\n"
2707 "    off64_t new_offset;\n"
2708 "    struct memfile_cookie *cookie = c;\n"
2709 msgstr ""
2710
2711 #. type: Plain text
2712 #: build/C/man3/fopencookie.3:351
2713 #, no-wrap
2714 msgid ""
2715 "    if (whence == SEEK_SET)\n"
2716 "        new_offset = *offset;\n"
2717 "    else if (whence == SEEK_END)\n"
2718 "        new_offset = cookie-E<gt>endpos + *offset;\n"
2719 "    else if (whence == SEEK_CUR)\n"
2720 "        new_offset = cookie-E<gt>offset + *offset;\n"
2721 "    else\n"
2722 "        return -1;\n"
2723 msgstr ""
2724
2725 #. type: Plain text
2726 #: build/C/man3/fopencookie.3:354
2727 #, no-wrap
2728 msgid ""
2729 "    if (new_offset E<lt> 0)\n"
2730 "        return -1;\n"
2731 msgstr ""
2732
2733 #. type: Plain text
2734 #: build/C/man3/fopencookie.3:359
2735 #, no-wrap
2736 msgid ""
2737 "    cookie-E<gt>offset = new_offset;\n"
2738 "    *offset = new_offset;\n"
2739 "    return 0;\n"
2740 "}\n"
2741 msgstr ""
2742
2743 #. type: Plain text
2744 #: build/C/man3/fopencookie.3:364
2745 #, no-wrap
2746 msgid ""
2747 "int\n"
2748 "memfile_close(void *c)\n"
2749 "{\n"
2750 "    struct memfile_cookie *cookie = c;\n"
2751 msgstr ""
2752
2753 #. type: Plain text
2754 #: build/C/man3/fopencookie.3:368
2755 #, no-wrap
2756 msgid ""
2757 "    free(cookie-E<gt>buf);\n"
2758 "    cookie-E<gt>allocated = 0;\n"
2759 "    cookie-E<gt>buf = NULL;\n"
2760 msgstr ""
2761
2762 #. type: Plain text
2763 #: build/C/man3/fopencookie.3:371
2764 #, no-wrap
2765 msgid ""
2766 "    return 0;\n"
2767 "}\n"
2768 msgstr ""
2769
2770 #. type: Plain text
2771 #: build/C/man3/fopencookie.3:387
2772 #, no-wrap
2773 msgid ""
2774 "int\n"
2775 "main(int argc, char *argv[])\n"
2776 "{\n"
2777 "    cookie_io_functions_t  memfile_func = {\n"
2778 "        .read  = memfile_read,\n"
2779 "        .write = memfile_write,\n"
2780 "        .seek  = memfile_seek,\n"
2781 "        .close = memfile_close\n"
2782 "    };\n"
2783 "    FILE *fp;\n"
2784 "    struct memfile_cookie mycookie;\n"
2785 "    ssize_t nread;\n"
2786 "    long p;\n"
2787 "    int j;\n"
2788 "    char buf[1000];\n"
2789 msgstr ""
2790
2791 #. type: Plain text
2792 #: build/C/man3/fopencookie.3:389
2793 #, no-wrap
2794 msgid "    /* Set up the cookie before calling fopencookie() */\n"
2795 msgstr ""
2796
2797 #. type: Plain text
2798 #: build/C/man3/fopencookie.3:395
2799 #, no-wrap
2800 msgid ""
2801 "    mycookie.buf = malloc(INIT_BUF_SIZE);\n"
2802 "    if (mycookie.buf == NULL) {\n"
2803 "        perror(\"malloc\");\n"
2804 "        exit(EXIT_FAILURE);\n"
2805 "    }\n"
2806 msgstr ""
2807
2808 #. type: Plain text
2809 #: build/C/man3/fopencookie.3:399
2810 #, no-wrap
2811 msgid ""
2812 "    mycookie.allocated = INIT_BUF_SIZE;\n"
2813 "    mycookie.offset = 0;\n"
2814 "    mycookie.endpos = 0;\n"
2815 msgstr ""
2816
2817 #. type: Plain text
2818 #: build/C/man3/fopencookie.3:405
2819 #, no-wrap
2820 msgid ""
2821 "    fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
2822 "    if (fp == NULL) {\n"
2823 "        perror(\"fopencookie\");\n"
2824 "        exit(EXIT_FAILURE);\n"
2825 "    }\n"
2826 msgstr ""
2827
2828 #. type: Plain text
2829 #: build/C/man3/fopencookie.3:407
2830 #, no-wrap
2831 msgid "    /* Write command-line arguments to our file */\n"
2832 msgstr ""
2833
2834 #. type: Plain text
2835 #: build/C/man3/fopencookie.3:413
2836 #, no-wrap
2837 msgid ""
2838 "    for (j = 1; j E<lt> argc; j++)\n"
2839 "        if (fputs(argv[j], fp) == EOF) {\n"
2840 "            perror(\"fputs\");\n"
2841 "            exit(EXIT_FAILURE);\n"
2842 "        }\n"
2843 msgstr ""
2844
2845 #. type: Plain text
2846 #: build/C/man3/fopencookie.3:415
2847 #, no-wrap
2848 msgid "    /* Read two bytes out of every five, until EOF */\n"
2849 msgstr ""
2850
2851 #. type: Plain text
2852 #: build/C/man3/fopencookie.3:430
2853 #, no-wrap
2854 msgid ""
2855 "    for (p = 0; ; p += 5) {\n"
2856 "        if (fseek(fp, p, SEEK_SET) == -1) {\n"
2857 "            perror(\"fseek\");\n"
2858 "            exit(EXIT_FAILURE);\n"
2859 "        }\n"
2860 "        nread = fread(buf, 1, 2, fp);\n"
2861 "        if (nread == -1) {\n"
2862 "            perror(\"fread\");\n"
2863 "            exit(EXIT_FAILURE);\n"
2864 "        }\n"
2865 "        if (nread == 0) {\n"
2866 "            printf(\"Reached end of file\\en\");\n"
2867 "            break;\n"
2868 "        }\n"
2869 msgstr ""
2870
2871 #. type: Plain text
2872 #: build/C/man3/fopencookie.3:433
2873 #, no-wrap
2874 msgid ""
2875 "        printf(\"/%.*s/\\en\", nread, buf);\n"
2876 "    }\n"
2877 msgstr ""
2878
2879 #. type: Plain text
2880 #: build/C/man3/fopencookie.3:436 build/C/man2/readlink.2:213
2881 #, no-wrap
2882 msgid ""
2883 "    exit(EXIT_SUCCESS);\n"
2884 "}\n"
2885 msgstr ""
2886
2887 #. type: Plain text
2888 #: build/C/man3/fopencookie.3:442
2889 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
2890 msgstr ""
2891
2892 #. type: TH
2893 #: build/C/man3/fpurge.3:25
2894 #, no-wrap
2895 msgid "FPURGE"
2896 msgstr ""
2897
2898 #. type: TH
2899 #: build/C/man3/fpurge.3:25
2900 #, no-wrap
2901 msgid "2001-12-15"
2902 msgstr ""
2903
2904 #. type: Plain text
2905 #: build/C/man3/fpurge.3:28
2906 msgid "fpurge, __fpurge - purge a stream"
2907 msgstr ""
2908
2909 #. type: Plain text
2910 #: build/C/man3/fpurge.3:32
2911 #, no-wrap
2912 msgid ""
2913 "/* unsupported */\n"
2914 "B<#include E<lt>stdio.hE<gt>>\n"
2915 msgstr ""
2916
2917 #. type: Plain text
2918 #: build/C/man3/fpurge.3:34
2919 #, no-wrap
2920 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
2921 msgstr ""
2922
2923 #. type: Plain text
2924 #: build/C/man3/fpurge.3:37
2925 #, no-wrap
2926 msgid ""
2927 "/* supported */\n"
2928 "B<#include E<lt>stdio.hE<gt>>\n"
2929 msgstr ""
2930
2931 #. type: Plain text
2932 #: build/C/man3/fpurge.3:39
2933 #, no-wrap
2934 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
2935 msgstr ""
2936
2937 #. type: Plain text
2938 #: build/C/man3/fpurge.3:41
2939 #, no-wrap
2940 msgid "B<void  __fpurge(FILE *>I<stream>B<);>\n"
2941 msgstr ""
2942
2943 #. type: Plain text
2944 #: build/C/man3/fpurge.3:54
2945 msgid ""
2946 "The function B<fpurge>()  clears the buffers of the given stream.  For "
2947 "output streams this discards any unwritten output.  For input streams this "
2948 "discards any input read from the underlying object but not yet obtained via "
2949 "B<getc>(3); this includes any text pushed back via B<ungetc>(3).  See also "
2950 "B<fflush>(3)."
2951 msgstr ""
2952
2953 #. type: Plain text
2954 #: build/C/man3/fpurge.3:58
2955 msgid ""
2956 "The function B<__fpurge>()  does precisely the same, but without returning a "
2957 "value."
2958 msgstr ""
2959
2960 #. type: Plain text
2961 #: build/C/man3/fpurge.3:65
2962 msgid ""
2963 "Upon successful completion B<fpurge>()  returns 0.  On error, it returns -1 "
2964 "and sets I<errno> appropriately."
2965 msgstr ""
2966
2967 #. type: Plain text
2968 #: build/C/man3/fpurge.3:70
2969 msgid "I<stream> is not an open stream."
2970 msgstr ""
2971
2972 #. type: Plain text
2973 #: build/C/man3/fpurge.3:78
2974 msgid ""
2975 "These functions are nonstandard and not portable.  The function B<fpurge>()  "
2976 "was introduced in 4.4BSD and is not available under Linux.  The function "
2977 "B<__fpurge>()  was introduced in Solaris, and is present in glibc 2.1.95 and "
2978 "later."
2979 msgstr ""
2980
2981 #. type: Plain text
2982 #: build/C/man3/fpurge.3:80
2983 msgid "Usually it is a mistake to want to discard input buffers."
2984 msgstr ""
2985
2986 #.  .BR fclean (3),
2987 #. type: Plain text
2988 #: build/C/man3/fpurge.3:85
2989 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
2990 msgstr ""
2991
2992 #. type: TH
2993 #: build/C/man3/fputwc.3:16
2994 #, no-wrap
2995 msgid "FPUTWC"
2996 msgstr ""
2997
2998 #. type: Plain text
2999 #: build/C/man3/fputwc.3:19
3000 msgid "fputwc, putwc - write a wide character to a FILE stream"
3001 msgstr ""
3002
3003 #. type: Plain text
3004 #: build/C/man3/fputwc.3:27
3005 #, no-wrap
3006 msgid ""
3007 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
3008 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
3009 msgstr ""
3010
3011 #. type: Plain text
3012 #: build/C/man3/fputwc.3:43
3013 msgid ""
3014 "The B<fputwc>()  function is the wide-character equivalent of the "
3015 "B<fputc>(3)  function.  It writes the wide character I<wc> to I<stream>.  If "
3016 "I<ferror(stream)> becomes true, it returns B<WEOF>.  If a wide-character "
3017 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>.  "
3018 "Otherwise it returns I<wc>."
3019 msgstr ""
3020
3021 #. type: Plain text
3022 #: build/C/man3/fputwc.3:51
3023 msgid ""
3024 "The B<putwc>()  function or macro functions identically to B<fputwc>().  It "
3025 "may be implemented as a macro, and may evaluate its argument more than "
3026 "once.  There is no reason ever to use it."
3027 msgstr ""
3028
3029 #. type: Plain text
3030 #: build/C/man3/fputwc.3:60
3031 msgid ""
3032 "The B<fputwc>()  function returns I<wc> if no error occurred, or B<WEOF> to "
3033 "indicate an error."
3034 msgstr ""
3035
3036 #. type: Plain text
3037 #: build/C/man3/fputwc.3:65
3038 msgid "Conversion of I<wc> to the stream's encoding fails."
3039 msgstr ""
3040
3041 #. type: Plain text
3042 #: build/C/man3/fputwc.3:74
3043 msgid ""
3044 "The behavior of B<fputwc>()  depends on the B<LC_CTYPE> category of the "
3045 "current locale."
3046 msgstr ""
3047
3048 #. type: Plain text
3049 #: build/C/man3/fputwc.3:82
3050 msgid ""
3051 "In the absence of additional information passed to the B<fopen>(3)  call, it "
3052 "is reasonable to expect that B<fputwc>()  will actually write the multibyte "
3053 "sequence corresponding to the wide character I<wc>."
3054 msgstr ""
3055
3056 #. type: Plain text
3057 #: build/C/man3/fputwc.3:86
3058 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
3059 msgstr ""
3060
3061 #. type: TH
3062 #: build/C/man3/fread.3:45
3063 #, no-wrap
3064 msgid "FREAD"
3065 msgstr ""
3066
3067 #. type: TH
3068 #: build/C/man3/fread.3:45
3069 #, no-wrap
3070 msgid "2012-03-30"
3071 msgstr ""
3072
3073 #. type: Plain text
3074 #: build/C/man3/fread.3:48
3075 msgid "fread, fwrite - binary stream input/output"
3076 msgstr ""
3077
3078 #. type: Plain text
3079 #: build/C/man3/fread.3:54
3080 #, no-wrap
3081 msgid ""
3082 "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE "
3083 "*>I<stream>B<);>\n"
3084 msgstr ""
3085
3086 #. type: Plain text
3087 #: build/C/man3/fread.3:57
3088 #, no-wrap
3089 msgid ""
3090 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
3091 ">I<nmemb>B<,>\n"
3092 "B<              FILE *>I<stream>B<);>\n"
3093 msgstr ""
3094
3095 #. type: Plain text
3096 #: build/C/man3/fread.3:69
3097 msgid ""
3098 "The function B<fread>()  reads I<nmemb> elements of data, each I<size> bytes "
3099 "long, from the stream pointed to by I<stream>, storing them at the location "
3100 "given by I<ptr>."
3101 msgstr ""
3102
3103 #. type: Plain text
3104 #: build/C/man3/fread.3:80
3105 msgid ""
3106 "The function B<fwrite>()  writes I<nmemb> elements of data, each I<size> "
3107 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
3108 "location given by I<ptr>."
3109 msgstr ""
3110
3111 #. type: Plain text
3112 #: build/C/man3/fread.3:96
3113 msgid ""
3114 "On success, B<fread>()  and B<fwrite>()  return the number of I<items> read "
3115 "or written.  This number equals the number of bytes transferred only when "
3116 "I<size> is 1.  If an error occurs, or the end of the file is reached, the "
3117 "return value is a short item count (or zero)."
3118 msgstr ""
3119
3120 #. type: Plain text
3121 #: build/C/man3/fread.3:103
3122 msgid ""
3123 "B<fread>()  does not distinguish between end-of-file and error, and callers "
3124 "must use B<feof>(3)  and B<ferror>(3)  to determine which occurred."
3125 msgstr ""
3126
3127 #. type: Plain text
3128 #: build/C/man3/fread.3:105
3129 msgid "C89, POSIX.1-2001."
3130 msgstr ""
3131
3132 #. type: Plain text
3133 #: build/C/man3/fread.3:111
3134 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
3135 msgstr ""
3136
3137 #. type: TH
3138 #: build/C/man3/fseek.3:42
3139 #, no-wrap
3140 msgid "FSEEK"
3141 msgstr ""
3142
3143 #. type: TH
3144 #: build/C/man3/fseek.3:42
3145 #, no-wrap
3146 msgid "1993-11-29"
3147 msgstr ""
3148
3149 #. type: Plain text
3150 #: build/C/man3/fseek.3:45
3151 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
3152 msgstr ""
3153
3154 #. type: Plain text
3155 #: build/C/man3/fseek.3:49
3156 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
3157 msgstr ""
3158
3159 #. type: Plain text
3160 #: build/C/man3/fseek.3:51
3161 msgid "B<long ftell(FILE *>I<stream>B<);>"
3162 msgstr ""
3163
3164 #. type: Plain text
3165 #: build/C/man3/fseek.3:53
3166 msgid "B<void rewind(FILE *>I<stream>B<);>"
3167 msgstr ""
3168
3169 #. type: Plain text
3170 #: build/C/man3/fseek.3:55
3171 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3172 msgstr ""
3173
3174 #. type: Plain text
3175 #: build/C/man3/fseek.3:57
3176 msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3177 msgstr ""
3178
3179 #. type: Plain text
3180 #: build/C/man3/fseek.3:81
3181 msgid ""
3182 "The B<fseek>()  function sets the file position indicator for the stream "
3183 "pointed to by I<stream>.  The new position, measured in bytes, is obtained "
3184 "by adding I<offset> bytes to the position specified by I<whence>.  If "
3185 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
3186 "relative to the start of the file, the current position indicator, or "
3187 "end-of-file, respectively.  A successful call to the B<fseek>()  function "
3188 "clears the end-of-file indicator for the stream and undoes any effects of "
3189 "the B<ungetc>(3)  function on the same stream."
3190 msgstr ""
3191
3192 #. type: Plain text
3193 #: build/C/man3/fseek.3:87
3194 msgid ""
3195 "The B<ftell>()  function obtains the current value of the file position "
3196 "indicator for the stream pointed to by I<stream>."
3197 msgstr ""
3198
3199 #. type: Plain text
3200 #: build/C/man3/fseek.3:94
3201 msgid ""
3202 "The B<rewind>()  function sets the file position indicator for the stream "
3203 "pointed to by I<stream> to the beginning of the file.  It is equivalent to:"
3204 msgstr ""
3205
3206 #. type: Plain text
3207 #: build/C/man3/fseek.3:97
3208 msgid "(void) fseek(stream, 0L, SEEK_SET)"
3209 msgstr ""
3210
3211 #. type: Plain text
3212 #: build/C/man3/fseek.3:101
3213 msgid ""
3214 "except that the error indicator for the stream is also cleared (see "
3215 "B<clearerr>(3))."
3216 msgstr ""
3217
3218 #. type: Plain text
3219 #: build/C/man3/fseek.3:121
3220 msgid ""
3221 "The B<fgetpos>()  and B<fsetpos>()  functions are alternate interfaces "
3222 "equivalent to B<ftell>()  and B<fseek>()  (with I<whence> set to "
3223 "B<SEEK_SET>), setting and storing the current value of the file offset into "
3224 "or from the object referenced by I<pos>.  On some non-UNIX systems, an "
3225 "I<fpos_t> object may be a complex object and these routines may be the only "
3226 "way to portably reposition a text stream."
3227 msgstr ""
3228
3229 #. type: Plain text
3230 #: build/C/man3/fseek.3:136
3231 msgid ""
3232 "The B<rewind>()  function returns no value.  Upon successful completion, "
3233 "B<fgetpos>(), B<fseek>(), B<fsetpos>()  return 0, and B<ftell>()  returns "
3234 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3235 "indicate the error."
3236 msgstr ""
3237
3238 #. type: Plain text
3239 #: build/C/man3/fseek.3:142
3240 msgid "The I<stream> specified is not a seekable stream."
3241 msgstr ""
3242
3243 #. type: Plain text
3244 #: build/C/man3/fseek.3:153
3245 msgid ""
3246 "The I<whence> argument to B<fseek>()  was not B<SEEK_SET>, B<SEEK_END>, or "
3247 "B<SEEK_CUR>."
3248 msgstr ""
3249
3250 #. type: Plain text
3251 #: build/C/man3/fseek.3:168
3252 msgid ""
3253 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>()  may "
3254 "also fail and set I<errno> for any of the errors specified for the routines "
3255 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
3256 msgstr ""
3257
3258 #. type: Plain text
3259 #: build/C/man3/fseek.3:173
3260 msgid "B<lseek>(2), B<fseeko>(3)"
3261 msgstr ""
3262
3263 #. type: TH
3264 #: build/C/man3/fseeko.3:25
3265 #, no-wrap
3266 msgid "FSEEKO"
3267 msgstr ""
3268
3269 #. type: TH
3270 #: build/C/man3/fseeko.3:25
3271 #, no-wrap
3272 msgid "2001-11-05"
3273 msgstr ""
3274
3275 #. type: Plain text
3276 #: build/C/man3/fseeko.3:28
3277 msgid "fseeko, ftello - seek to or report file position"
3278 msgstr ""
3279
3280 #. type: Plain text
3281 #: build/C/man3/fseeko.3:33
3282 #, no-wrap
3283 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
3284 msgstr ""
3285
3286 #. type: Plain text
3287 #: build/C/man3/fseeko.3:36
3288 #, no-wrap
3289 msgid ""
3290 "B<off_t ftello(FILE *>I<stream>B<);>\n"
3291 "\n"
3292 msgstr ""
3293
3294 #. type: Plain text
3295 #: build/C/man3/fseeko.3:54
3296 msgid ""
3297 "The B<fseeko>()  and B<ftello>()  functions are identical to B<fseek>(3)  "
3298 "and B<ftell>(3)  (see B<fseek>(3)), respectively, except that the I<offset> "
3299 "argument of B<fseeko>()  and the return value of B<ftello>()  is of type "
3300 "I<off_t> instead of I<long>."
3301 msgstr ""
3302
3303 #. type: Plain text
3304 #: build/C/man3/fseeko.3:57
3305 msgid ""
3306 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
3307 "compilation with"
3308 msgstr ""
3309
3310 #. type: Plain text
3311 #: build/C/man3/fseeko.3:61 build/C/man3/lseek64.3:81
3312 #, no-wrap
3313 msgid "#define _FILE_OFFSET_BITS 64\n"
3314 msgstr ""
3315
3316 #. type: Plain text
3317 #: build/C/man3/fseeko.3:65
3318 msgid "will turn I<off_t> into a 64-bit type."
3319 msgstr ""
3320
3321 #. type: Plain text
3322 #: build/C/man3/fseeko.3:74
3323 msgid ""
3324 "On successful completion, B<fseeko>()  returns 0, while B<ftello>()  returns "
3325 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3326 "indicate the error."
3327 msgstr ""
3328
3329 #. type: Plain text
3330 #: build/C/man3/fseeko.3:77
3331 msgid "See the ERRORS in B<fseek>(3)."
3332 msgstr ""
3333
3334 #. type: Plain text
3335 #: build/C/man3/fseeko.3:79
3336 msgid "SUSv2, POSIX.1-2001."
3337 msgstr ""
3338
3339 #. type: Plain text
3340 #: build/C/man3/fseeko.3:83
3341 msgid ""
3342 "These functions are found on System V-like systems.  They are not present in "
3343 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
3344 msgstr ""
3345
3346 #. type: Plain text
3347 #: build/C/man3/fseeko.3:85
3348 msgid "B<fseek>(3)"
3349 msgstr ""
3350
3351 #. type: TH
3352 #: build/C/man3/getline.3:26
3353 #, no-wrap
3354 msgid "GETLINE"
3355 msgstr ""
3356
3357 #. type: TH
3358 #: build/C/man3/getline.3:26
3359 #, no-wrap
3360 msgid "2010-06-12"
3361 msgstr ""
3362
3363 #. type: Plain text
3364 #: build/C/man3/getline.3:29
3365 msgid "getline, getdelim - delimited string input"
3366 msgstr ""
3367
3368 #. type: Plain text
3369 #: build/C/man3/getline.3:34
3370 #, no-wrap
3371 msgid ""
3372 "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE "
3373 "*>I<stream>B<);>\n"
3374 msgstr ""
3375
3376 #. type: Plain text
3377 #: build/C/man3/getline.3:37
3378 #, no-wrap
3379 msgid ""
3380 "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, "
3381 "FILE *>I<stream>B<);>\n"
3382 msgstr ""
3383
3384 #. type: Plain text
3385 #: build/C/man3/getline.3:47
3386 msgid "B<getline>(), B<getdelim>():"
3387 msgstr ""
3388
3389 #. type: Plain text
3390 #: build/C/man3/getline.3:52
3391 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
3392 msgstr ""
3393
3394 #. type: Plain text
3395 #: build/C/man3/getline.3:65
3396 msgid ""
3397 "B<getline>()  reads an entire line from I<stream>, storing the address of "
3398 "the buffer containing the text into I<*lineptr>.  The buffer is "
3399 "null-terminated and includes the newline character, if one was found."
3400 msgstr ""
3401
3402 #. type: Plain text
3403 #: build/C/man3/getline.3:75
3404 msgid ""
3405 "If I<*lineptr> is NULL, then B<getline>()  will allocate a buffer for "
3406 "storing the line, which should be freed by the user program.  (In this case, "
3407 "the value in I<*n> is ignored.)"
3408 msgstr ""
3409
3410 #. type: Plain text
3411 #: build/C/man3/getline.3:93
3412 msgid ""
3413 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
3414 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size.  If the "
3415 "buffer is not large enough to hold the line, B<getline>()  resizes it with "
3416 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
3417 msgstr ""
3418
3419 #. type: Plain text
3420 #: build/C/man3/getline.3:99
3421 msgid ""
3422 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
3423 "to reflect the buffer address and allocated size respectively."
3424 msgstr ""
3425
3426 #. type: Plain text
3427 #: build/C/man3/getline.3:110
3428 msgid ""
3429 "B<getdelim>()  works like B<getline>(), except that a line delimiter other "
3430 "than newline can be specified as the I<delimiter> argument.  As with "
3431 "B<getline>(), a delimiter character is not added if one was not present in "
3432 "the input before end of file was reached."
3433 msgstr ""
3434
3435 #. type: Plain text
3436 #: build/C/man3/getline.3:119
3437 msgid ""
3438 "On success, B<getline>()  and B<getdelim>()  return the number of characters "
3439 "read, including the delimiter character, but not including the terminating "
3440 "null byte.  This value can be used to handle embedded null bytes in the line "
3441 "read."
3442 msgstr ""
3443
3444 #. type: Plain text
3445 #: build/C/man3/getline.3:122
3446 msgid ""
3447 "Both functions return -1 on failure to read a line (including end-of-file "
3448 "condition)."
3449 msgstr ""
3450
3451 #. type: Plain text
3452 #: build/C/man3/getline.3:132
3453 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
3454 msgstr ""
3455
3456 #. type: Plain text
3457 #: build/C/man3/getline.3:134
3458 msgid "These functions are available since libc 4.6.27."
3459 msgstr ""
3460
3461 #. type: Plain text
3462 #: build/C/man3/getline.3:141
3463 msgid ""
3464 "Both B<getline>()  and B<getdelim>()  were originally GNU extensions.  They "
3465 "were standardized in POSIX.1-2008."
3466 msgstr ""
3467
3468 #. type: Plain text
3469 #: build/C/man3/getline.3:146
3470 #, no-wrap
3471 msgid ""
3472 "#define _GNU_SOURCE\n"
3473 "#include E<lt>stdio.hE<gt>\n"
3474 "#include E<lt>stdlib.hE<gt>\n"
3475 msgstr ""
3476
3477 #. type: Plain text
3478 #: build/C/man3/getline.3:154
3479 #, no-wrap
3480 msgid ""
3481 "int\n"
3482 "main(void)\n"
3483 "{\n"
3484 "    FILE *fp;\n"
3485 "    char *line = NULL;\n"
3486 "    size_t len = 0;\n"
3487 "    ssize_t read;\n"
3488 msgstr ""
3489
3490 #. type: Plain text
3491 #: build/C/man3/getline.3:158
3492 #, no-wrap
3493 msgid ""
3494 "    fp = fopen(\"/etc/motd\", \"r\");\n"
3495 "    if (fp == NULL)\n"
3496 "        exit(EXIT_FAILURE);\n"
3497 msgstr ""
3498
3499 #. type: Plain text
3500 #: build/C/man3/getline.3:163
3501 #, no-wrap
3502 msgid ""
3503 "    while ((read = getline(&line, &len, fp)) != -1) {\n"
3504 "        printf(\"Retrieved line of length %zu :\\en\", read);\n"
3505 "        printf(\"%s\", line);\n"
3506 "    }\n"
3507 msgstr ""
3508
3509 #. type: Plain text
3510 #: build/C/man3/getline.3:167
3511 #, no-wrap
3512 msgid ""
3513 "    free(line);\n"
3514 "    exit(EXIT_SUCCESS);\n"
3515 "}\n"
3516 msgstr ""
3517
3518 #. type: Plain text
3519 #: build/C/man3/getline.3:175
3520 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<gets>(3), B<scanf>(3)"
3521 msgstr ""
3522
3523 #. type: TH
3524 #: build/C/man3/gets.3:27
3525 #, no-wrap
3526 msgid "GETS"
3527 msgstr ""
3528
3529 #. type: TH
3530 #: build/C/man3/gets.3:27
3531 #, no-wrap
3532 msgid "2012-01-18"
3533 msgstr ""
3534
3535 #. type: Plain text
3536 #: build/C/man3/gets.3:30
3537 msgid "fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings"
3538 msgstr ""
3539
3540 #. type: Plain text
3541 #: build/C/man3/gets.3:35
3542 #, no-wrap
3543 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
3544 msgstr ""
3545
3546 #. type: Plain text
3547 #: build/C/man3/gets.3:37
3548 #, no-wrap
3549 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
3550 msgstr ""
3551
3552 #. type: Plain text
3553 #: build/C/man3/gets.3:39
3554 #, no-wrap
3555 msgid "B<int getc(FILE *>I<stream>B<);>\n"
3556 msgstr ""
3557
3558 #. type: Plain text
3559 #: build/C/man3/gets.3:41
3560 #, no-wrap
3561 msgid "B<int getchar(void);>\n"
3562 msgstr ""
3563
3564 #. type: Plain text
3565 #: build/C/man3/gets.3:43
3566 #, no-wrap
3567 msgid "B<char *gets(char *>I<s>B<);>\n"
3568 msgstr ""
3569
3570 #. type: Plain text
3571 #: build/C/man3/gets.3:45
3572 #, no-wrap
3573 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
3574 msgstr ""
3575
3576 #. type: Plain text
3577 #: build/C/man3/gets.3:57
3578 msgid ""
3579 "B<fgetc>()  reads the next character from I<stream> and returns it as an "
3580 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
3581 msgstr ""
3582
3583 #. type: Plain text
3584 #: build/C/man3/gets.3:64
3585 msgid ""
3586 "B<getc>()  is equivalent to B<fgetc>()  except that it may be implemented as "
3587 "a macro which evaluates I<stream> more than once."
3588 msgstr ""
3589
3590 #. type: Plain text
3591 #: build/C/man3/gets.3:68
3592 msgid "B<getchar>()  is equivalent to B<getc(>I<stdin>B<)>."
3593 msgstr ""
3594
3595 #. type: Plain text
3596 #: build/C/man3/gets.3:78
3597 msgid ""
3598 "B<gets>()  reads a line from I<stdin> into the buffer pointed to by I<s> "
3599 "until either a terminating newline or B<EOF>, which it replaces with a null "
3600 "byte (\\(aq\\e0\\(aq).  No check for buffer overrun is performed (see BUGS "
3601 "below)."
3602 msgstr ""
3603
3604 #. type: Plain text
3605 #: build/C/man3/gets.3:92
3606 msgid ""
3607 "B<fgets>()  reads in at most one less than I<size> characters from I<stream> "
3608 "and stores them into the buffer pointed to by I<s>.  Reading stops after an "
3609 "B<EOF> or a newline.  If a newline is read, it is stored into the buffer.  A "
3610 "terminating null byte (\\(aq\\e0\\(aq)  is stored after the last character "
3611 "in the buffer."
3612 msgstr ""
3613
3614 #. type: Plain text
3615 #: build/C/man3/gets.3:103
3616 msgid ""
3617 "B<ungetc>()  pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
3618 "it is available for subsequent read operations.  Pushed-back characters will "
3619 "be returned in reverse order; only one pushback is guaranteed."
3620 msgstr ""
3621
3622 #. type: Plain text
3623 #: build/C/man3/gets.3:108
3624 msgid ""
3625 "Calls to the functions described here can be mixed with each other and with "
3626 "calls to other input functions from the I<stdio> library for the same input "
3627 "stream."
3628 msgstr ""
3629
3630 #. type: Plain text
3631 #: build/C/man3/gets.3:123
3632 msgid ""
3633 "B<fgetc>(), B<getc>()  and B<getchar>()  return the character read as an "
3634 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
3635 msgstr ""
3636
3637 #. type: Plain text
3638 #: build/C/man3/gets.3:131
3639 msgid ""
3640 "B<gets>()  and B<fgets>()  return I<s> on success, and NULL on error or when "
3641 "end of file occurs while no characters have been read."
3642 msgstr ""
3643
3644 #. type: Plain text
3645 #: build/C/man3/gets.3:138
3646 msgid "B<ungetc>()  returns I<c> on success, or B<EOF> on error."
3647 msgstr ""
3648
3649 #. type: Plain text
3650 #: build/C/man3/gets.3:140
3651 msgid "C89, C99, POSIX.1-2001."
3652 msgstr ""
3653
3654 #. type: Plain text
3655 #: build/C/man3/gets.3:152
3656 msgid ""
3657 "LSB deprecates B<gets>().  POSIX.1-2008 marks B<gets>()  obsolescent.  ISO "
3658 "C11 removes the specification of B<gets>()  from the C language, and since "
3659 "version 2.16, glibc header files don't expose the function declaration if "
3660 "the B<_ISOC11_SOURCE> feature test macro is defined."
3661 msgstr ""
3662
3663 #. type: Plain text
3664 #: build/C/man3/gets.3:166
3665 msgid ""
3666 "Never use B<gets>().  Because it is impossible to tell without knowing the "
3667 "data in advance how many characters B<gets>()  will read, and because "
3668 "B<gets>()  will continue to store characters past the end of the buffer, it "
3669 "is extremely dangerous to use.  It has been used to break computer "
3670 "security.  Use B<fgets>()  instead."
3671 msgstr ""
3672
3673 #. type: Plain text
3674 #: build/C/man3/gets.3:173
3675 msgid ""
3676 "It is not advisable to mix calls to input functions from the I<stdio> "
3677 "library with low-level calls to B<read>(2)  for the file descriptor "
3678 "associated with the input stream; the results will be undefined and very "
3679 "probably not what you want."
3680 msgstr ""
3681
3682 #. type: Plain text
3683 #: build/C/man3/gets.3:189
3684 msgid ""
3685 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
3686 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<getwchar>(3), "
3687 "B<puts>(3), B<scanf>(3), B<ungetwc>(3), B<unlocked_stdio>(3), "
3688 "B<feature_test_macros>(7)"
3689 msgstr ""
3690
3691 #. type: TH
3692 #: build/C/man3/getw.3:25
3693 #, no-wrap
3694 msgid "GETW"
3695 msgstr ""
3696
3697 #. type: TH
3698 #: build/C/man3/getw.3:25
3699 #, no-wrap
3700 msgid "2010-09-26"
3701 msgstr ""
3702
3703 #. type: Plain text
3704 #: build/C/man3/getw.3:28
3705 msgid "getw, putw - input and output of words (ints)"
3706 msgstr ""
3707
3708 #. type: Plain text
3709 #: build/C/man3/getw.3:33
3710 #, no-wrap
3711 msgid "B<int getw(FILE *>I<stream>B<);>\n"
3712 msgstr ""
3713
3714 #. type: Plain text
3715 #: build/C/man3/getw.3:35
3716 #, no-wrap
3717 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
3718 msgstr ""
3719
3720 #. type: Plain text
3721 #: build/C/man3/getw.3:44
3722 msgid "B<getw>(), B<putw>():"
3723 msgstr ""
3724
3725 #. type: TP
3726 #: build/C/man3/getw.3:47
3727 #, no-wrap
3728 msgid "Since glibc 2.3.3:"
3729 msgstr ""
3730
3731 #. type: Plain text
3732 #: build/C/man3/getw.3:50
3733 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
3734 msgstr ""
3735
3736 #. type: Plain text
3737 #: build/C/man3/getw.3:53
3738 #, no-wrap
3739 msgid ""
3740 "(_XOPEN_SOURCE &&\n"
3741 "    !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
3742 msgstr ""
3743
3744 #. type: TP
3745 #: build/C/man3/getw.3:53
3746 #, no-wrap
3747 msgid "Before glibc 2.3.3:"
3748 msgstr ""
3749
3750 #. type: Plain text
3751 #: build/C/man3/getw.3:56
3752 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
3753 msgstr ""
3754
3755 #. type: Plain text
3756 #: build/C/man3/getw.3:66
3757 msgid ""
3758 "B<getw>()  reads a word (that is, an I<int>) from I<stream>.  It's provided "
3759 "for compatibility with SVr4.  We recommend you use B<fread>(3)  instead."
3760 msgstr ""
3761
3762 #. type: Plain text
3763 #: build/C/man3/getw.3:73
3764 msgid ""
3765 "B<putw>()  writes the word I<w> (that is, an I<int>) to I<stream>.  It is "
3766 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3)  "
3767 "instead."
3768 msgstr ""
3769
3770 #. type: Plain text
3771 #: build/C/man3/getw.3:80
3772 msgid ""
3773 "Normally, B<getw>()  returns the word read, and B<putw>()  returns 0.  On "
3774 "error, they return B<EOF>."
3775 msgstr ""
3776
3777 #. type: Plain text
3778 #: build/C/man3/getw.3:82
3779 msgid "SVr4, SUSv2.  Not present in POSIX.1-2001."
3780 msgstr ""
3781
3782 #. type: Plain text
3783 #: build/C/man3/getw.3:86
3784 msgid ""
3785 "The value returned on error is also a legitimate data value.  B<ferror>(3)  "
3786 "can be used to distinguish between the two cases."
3787 msgstr ""
3788
3789 #. type: Plain text
3790 #: build/C/man3/getw.3:92
3791 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
3792 msgstr ""
3793
3794 #. type: TH
3795 #: build/C/man2/link.2:31
3796 #, no-wrap
3797 msgid "LINK"
3798 msgstr ""
3799
3800 #. type: TH
3801 #: build/C/man2/link.2:31 build/C/man2/rename.2:32 build/C/man2/symlink.2:32 build/C/man2/write.2:39
3802 #, no-wrap
3803 msgid "2013-01-27"
3804 msgstr ""
3805
3806 #. type: Plain text
3807 #: build/C/man2/link.2:34
3808 msgid "link - make a new name for a file"
3809 msgstr ""
3810
3811 #. type: Plain text
3812 #: 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
3813 msgid "B<#include E<lt>unistd.hE<gt>>"
3814 msgstr ""
3815
3816 #. type: Plain text
3817 #: build/C/man2/link.2:38
3818 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
3819 msgstr ""
3820
3821 #. type: Plain text
3822 #: build/C/man2/link.2:41
3823 msgid ""
3824 "B<link>()  creates a new link (also known as a hard link) to an existing "
3825 "file."
3826 msgstr ""
3827
3828 #. type: Plain text
3829 #: build/C/man2/link.2:47 build/C/man2/symlink.2:84
3830 msgid "If I<newpath> exists it will I<not> be overwritten."
3831 msgstr ""
3832
3833 #. type: Plain text
3834 #: build/C/man2/link.2:52
3835 msgid ""
3836 "This new name may be used exactly as the old one for any operation; both "
3837 "names refer to the same file (and so have the same permissions and "
3838 "ownership) and it is impossible to tell which name was the \"original\"."
3839 msgstr ""
3840
3841 #. type: Plain text
3842 #: 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
3843 msgid ""
3844 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
3845 "appropriately."
3846 msgstr ""
3847
3848 #. type: TP
3849 #: build/C/man2/link.2:58 build/C/man2/open.2:486 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:55 build/C/man2/unlink.2:61
3850 #, no-wrap
3851 msgid "B<EACCES>"
3852 msgstr ""
3853
3854 #. type: Plain text
3855 #: build/C/man2/link.2:69
3856 msgid ""
3857 "Write access to the directory containing I<newpath> is denied, or search "
3858 "permission is denied for one of the directories in the path prefix of "
3859 "I<oldpath> or I<newpath>.  (See also B<path_resolution>(7).)"
3860 msgstr ""
3861
3862 #. type: TP
3863 #: build/C/man2/link.2:69 build/C/man2/open.2:495 build/C/man2/rename.2:133 build/C/man2/symlink.2:99 build/C/man2/write.2:135
3864 #, no-wrap
3865 msgid "B<EDQUOT>"
3866 msgstr ""
3867
3868 #. type: Plain text
3869 #: build/C/man2/link.2:72 build/C/man2/rename.2:136
3870 msgid "The user's quota of disk blocks on the file system has been exhausted."
3871 msgstr ""
3872
3873 #. type: TP
3874 #: build/C/man2/link.2:72 build/C/man2/open.2:501 build/C/man2/symlink.2:104 build/C/man3/tmpfile.3:58
3875 #, no-wrap
3876 msgid "B<EEXIST>"
3877 msgstr ""
3878
3879 #. type: Plain text
3880 #: build/C/man2/link.2:76 build/C/man2/symlink.2:108
3881 msgid "I<newpath> already exists."
3882 msgstr ""
3883
3884 #. type: TP
3885 #: build/C/man2/link.2:76 build/C/man2/llseek.2:74 build/C/man2/open.2:507 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
3886 #, no-wrap
3887 msgid "B<EFAULT>"
3888 msgstr ""
3889
3890 #. type: Plain text
3891 #: build/C/man2/link.2:79 build/C/man2/rename.2:139 build/C/man2/symlink.2:111
3892 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
3893 msgstr ""
3894
3895 #. type: TP
3896 #: 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
3897 #, no-wrap
3898 msgid "B<EIO>"
3899 msgstr ""
3900
3901 #. type: Plain text
3902 #: build/C/man2/link.2:82 build/C/man2/symlink.2:114 build/C/man2/unlink.2:87
3903 msgid "An I/O error occurred."
3904 msgstr ""
3905
3906 #. type: TP
3907 #: build/C/man2/link.2:82 build/C/man2/open.2:531 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
3908 #, no-wrap
3909 msgid "B<ELOOP>"
3910 msgstr ""
3911
3912 #. type: Plain text
3913 #: build/C/man2/link.2:86 build/C/man2/rename.2:153
3914 msgid ""
3915 "Too many symbolic links were encountered in resolving I<oldpath> or "
3916 "I<newpath>."
3917 msgstr ""
3918
3919 #. type: TP
3920 #: build/C/man2/link.2:86 build/C/man2/rename.2:153
3921 #, no-wrap
3922 msgid "B<EMLINK>"
3923 msgstr ""
3924
3925 #. type: Plain text
3926 #: build/C/man2/link.2:91
3927 msgid ""
3928 "The file referred to by I<oldpath> already has the maximum number of links "
3929 "to it."
3930 msgstr ""
3931
3932 #. type: TP
3933 #: build/C/man2/link.2:91 build/C/man2/open.2:541 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
3934 #, no-wrap
3935 msgid "B<ENAMETOOLONG>"
3936 msgstr ""
3937
3938 #. type: Plain text
3939 #: build/C/man2/link.2:94 build/C/man2/rename.2:163 build/C/man2/symlink.2:121
3940 msgid "I<oldpath> or I<newpath> was too long."
3941 msgstr ""
3942
3943 #. type: TP
3944 #: build/C/man2/link.2:94 build/C/man2/open.2:555 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
3945 #, no-wrap
3946 msgid "B<ENOENT>"
3947 msgstr ""
3948
3949 #. type: Plain text
3950 #: build/C/man2/link.2:99
3951 msgid ""
3952 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
3953 "dangling symbolic link."
3954 msgstr ""
3955
3956 #. type: TP
3957 #: build/C/man2/link.2:99 build/C/man2/open.2:562 build/C/man2/readlink.2:119 build/C/man2/rename.2:176 build/C/man2/rmdir.2:85 build/C/man3/scanf.3:571 build/C/man2/symlink.2:128 build/C/man3/tempnam.3:93 build/C/man2/unlink.2:106
3958 #, no-wrap
3959 msgid "B<ENOMEM>"
3960 msgstr ""
3961
3962 #. type: Plain text
3963 #: build/C/man2/link.2:102 build/C/man2/open.2:565 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
3964 msgid "Insufficient kernel memory was available."
3965 msgstr ""
3966
3967 #. type: TP
3968 #: build/C/man2/link.2:102 build/C/man2/open.2:565 build/C/man2/rename.2:179 build/C/man2/symlink.2:131 build/C/man3/tmpfile.3:70 build/C/man2/write.2:168
3969 #, no-wrap
3970 msgid "B<ENOSPC>"
3971 msgstr ""
3972
3973 #. type: Plain text
3974 #: build/C/man2/link.2:106 build/C/man2/rename.2:183 build/C/man2/symlink.2:135
3975 msgid "The device containing the file has no room for the new directory entry."
3976 msgstr ""
3977
3978 #. type: TP
3979 #: build/C/man2/link.2:106 build/C/man2/open.2:571 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
3980 #, no-wrap
3981 msgid "B<ENOTDIR>"
3982 msgstr ""
3983
3984 #. type: Plain text
3985 #: build/C/man2/link.2:111
3986 msgid ""
3987 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
3988 "a directory."
3989 msgstr ""
3990
3991 #. type: TP
3992 #: build/C/man2/link.2:111 build/C/man2/link.2:115 build/C/man2/open.2:604 build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118 build/C/man2/symlink.2:140 build/C/man2/unlink.2:114
3993 #, no-wrap
3994 msgid "B<EPERM>"
3995 msgstr ""
3996
3997 #. type: Plain text
3998 #: build/C/man2/link.2:115
3999 msgid "I<oldpath> is a directory."
4000 msgstr ""
4001
4002 #. type: Plain text
4003 #: build/C/man2/link.2:120
4004 msgid ""
4005 "The file system containing I<oldpath> and I<newpath> does not support the "
4006 "creation of hard links."
4007 msgstr ""
4008
4009 #. type: TP
4010 #: build/C/man2/link.2:120
4011 #, no-wrap
4012 msgid "B<EPERM> (since Linux 3.6)"
4013 msgstr ""
4014
4015 #. type: Plain text
4016 #: build/C/man2/link.2:127
4017 msgid ""
4018 "The caller does not have permission to create a hard link to this file (see "
4019 "the description of I</proc/sys/fs/protected_hardlink> in B<proc>(5))."
4020 msgstr ""
4021
4022 #. type: TP
4023 #: build/C/man2/link.2:127 build/C/man2/open.2:612 build/C/man2/rename.2:221 build/C/man2/rmdir.2:123 build/C/man2/symlink.2:145 build/C/man3/tmpfile.3:73 build/C/man2/unlink.2:137
4024 #, no-wrap
4025 msgid "B<EROFS>"
4026 msgstr ""
4027
4028 #. type: Plain text
4029 #: build/C/man2/link.2:130 build/C/man2/rename.2:224
4030 msgid "The file is on a read-only file system."
4031 msgstr ""
4032
4033 #. type: TP
4034 #: build/C/man2/link.2:130 build/C/man2/rename.2:224
4035 #, no-wrap
4036 msgid "B<EXDEV>"
4037 msgstr ""
4038
4039 #. type: Plain text
4040 #: build/C/man2/link.2:138
4041 msgid ""
4042 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
4043 "permits a file system to be mounted at multiple points, but B<link>()  does "
4044 "not work across different mount points, even if the same file system is "
4045 "mounted on both.)"
4046 msgstr ""
4047
4048 #.  SVr4 documents additional ENOLINK and
4049 #.  EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
4050 #.  X/OPEN does not document EFAULT, ENOMEM or EIO.
4051 #. type: Plain text
4052 #: build/C/man2/link.2:143
4053 msgid "SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES)."
4054 msgstr ""
4055
4056 #. type: Plain text
4057 #: build/C/man2/link.2:150
4058 msgid ""
4059 "Hard links, as created by B<link>(), cannot span file systems.  Use "
4060 "B<symlink>(2)  if this is required."
4061 msgstr ""
4062
4063 #.  more precisely: since kernel 1.3.56
4064 #.  For example, the default Solaris compilation environment
4065 #.  behaves like Linux, and contributors to a March 2005
4066 #.  thread in the Austin mailing list reported that some
4067 #.  other (System V) implementations did/do the same -- MTK, Apr 05
4068 #. type: Plain text
4069 #: build/C/man2/link.2:181
4070 msgid ""
4071 "POSIX.1-2001 says that B<link>()  should dereference I<oldpath> if it is a "
4072 "symbolic link.  However, since kernel 2.0, Linux does not do so: if "
4073 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
4074 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
4075 "the same file that I<oldpath> refers to).  Some other implementations behave "
4076 "in the same manner as Linux.  POSIX.1-2008 changes the specification of "
4077 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
4078 "dereferenced if it is a symbolic link.  For precise control over the "
4079 "treatment of symbolic links when creating a link, see B<linkat>(2)."
4080 msgstr ""
4081
4082 #. type: Plain text
4083 #: build/C/man2/link.2:187
4084 msgid ""
4085 "On NFS file systems, the return code may be wrong in case the NFS server "
4086 "performs the link creation and dies before it can say so.  Use B<stat>(2)  "
4087 "to find out if the link got created."
4088 msgstr ""
4089
4090 #. type: Plain text
4091 #: build/C/man2/link.2:197
4092 msgid ""
4093 "B<ln>(1), B<linkat>(2), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), "
4094 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
4095 msgstr ""
4096
4097 #. type: TH
4098 #: build/C/man2/llseek.2:28
4099 #, no-wrap
4100 msgid "LLSEEK"
4101 msgstr ""
4102
4103 #. type: TH
4104 #: build/C/man2/llseek.2:28
4105 #, no-wrap
4106 msgid "2012-07-13"
4107 msgstr ""
4108
4109 #. type: Plain text
4110 #: build/C/man2/llseek.2:31
4111 msgid "_llseek - reposition read/write file offset"
4112 msgstr ""
4113
4114 #. type: Plain text
4115 #: build/C/man2/llseek.2:35
4116 #, no-wrap
4117 msgid ""
4118 "B<#include E<lt>sys/types.hE<gt>>\n"
4119 "B<#include E<lt>unistd.hE<gt>>\n"
4120 msgstr ""
4121
4122 #. type: Plain text
4123 #: build/C/man2/llseek.2:39
4124 #, no-wrap
4125 msgid ""
4126 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
4127 "B<            unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
4128 "B<            unsigned int >I<whence>B<);>\n"
4129 msgstr ""
4130
4131 #. type: Plain text
4132 #: build/C/man2/llseek.2:43
4133 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
4134 msgstr ""
4135
4136 #. type: Plain text
4137 #: build/C/man2/llseek.2:62
4138 msgid ""
4139 "The B<_llseek>()  function repositions the offset of the open file "
4140 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
4141 "offset_low> bytes relative to the beginning of the file, the current "
4142 "position in the file, or the end of the file, depending on whether I<whence> "
4143 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively.  It returns the "
4144 "resulting file position in the argument I<result>."
4145 msgstr ""
4146
4147 #. type: Plain text
4148 #: build/C/man2/llseek.2:69
4149 msgid ""
4150 "Upon successful completion, B<_llseek>()  returns 0.  Otherwise, a value of "
4151 "-1 is returned and I<errno> is set to indicate the error."
4152 msgstr ""
4153
4154 #. type: Plain text
4155 #: build/C/man2/llseek.2:74 build/C/man2/lseek.2:166
4156 msgid "I<fd> is not an open file descriptor."
4157 msgstr ""
4158
4159 #. type: Plain text
4160 #: build/C/man2/llseek.2:77
4161 msgid "Problem with copying results to user space."
4162 msgstr ""
4163
4164 #. type: Plain text
4165 #: build/C/man2/llseek.2:81
4166 msgid "I<whence> is invalid."
4167 msgstr ""
4168
4169 #. type: Plain text
4170 #: build/C/man2/llseek.2:84
4171 msgid ""
4172 "This function is Linux-specific, and should not be used in programs intended "
4173 "to be portable."
4174 msgstr ""
4175
4176 #. type: Plain text
4177 #: build/C/man2/llseek.2:87
4178 msgid ""
4179 "Glibc does not provide a wrapper for this system call; call it using "
4180 "B<syscall>(2)."
4181 msgstr ""
4182
4183 #. type: Plain text
4184 #: build/C/man2/llseek.2:90
4185 msgid "B<lseek>(2), B<lseek64>(3)"
4186 msgstr ""
4187
4188 #. type: TH
4189 #: build/C/man2/lseek.2:47
4190 #, no-wrap
4191 msgid "LSEEK"
4192 msgstr ""
4193
4194 #. type: TH
4195 #: build/C/man2/lseek.2:47
4196 #, no-wrap
4197 msgid "2011-09-25"
4198 msgstr ""
4199
4200 #. type: Plain text
4201 #: build/C/man2/lseek.2:50
4202 msgid "lseek - reposition read/write file offset"
4203 msgstr ""
4204
4205 #. type: Plain text
4206 #: build/C/man2/lseek.2:52 build/C/man3/lseek64.3:32
4207 msgid "B<#include E<lt>sys/types.hE<gt>>"
4208 msgstr ""
4209
4210 #. type: Plain text
4211 #: build/C/man2/lseek.2:56
4212 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
4213 msgstr ""
4214
4215 #. type: Plain text
4216 #: build/C/man2/lseek.2:67
4217 msgid ""
4218 "The B<lseek>()  function repositions the offset of the open file associated "
4219 "with the file descriptor I<fd> to the argument I<offset> according to the "
4220 "directive I<whence> as follows:"
4221 msgstr ""
4222
4223 #. type: Plain text
4224 #: build/C/man2/lseek.2:72
4225 msgid "The offset is set to I<offset> bytes."
4226 msgstr ""
4227
4228 #. type: Plain text
4229 #: build/C/man2/lseek.2:77
4230 msgid "The offset is set to its current location plus I<offset> bytes."
4231 msgstr ""
4232
4233 #. type: Plain text
4234 #: build/C/man2/lseek.2:82
4235 msgid "The offset is set to the size of the file plus I<offset> bytes."
4236 msgstr ""
4237
4238 #. type: Plain text
4239 #: build/C/man2/lseek.2:90
4240 msgid ""
4241 "The B<lseek>()  function allows the file offset to be set beyond the end of "
4242 "the file (but this does not change the size of the file).  If data is later "
4243 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
4244 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
4245 "gap."
4246 msgstr ""
4247
4248 #. type: SS
4249 #: build/C/man2/lseek.2:90
4250 #, no-wrap
4251 msgid "Seeking file data and holes"
4252 msgstr ""
4253
4254 #. type: Plain text
4255 #: build/C/man2/lseek.2:93
4256 msgid ""
4257 "Since version 3.1, Linux supports the following additional values for "
4258 "I<whence>:"
4259 msgstr ""
4260
4261 #. type: TP
4262 #: build/C/man2/lseek.2:93
4263 #, no-wrap
4264 msgid "B<SEEK_DATA>"
4265 msgstr ""
4266
4267 #. type: Plain text
4268 #: build/C/man2/lseek.2:104
4269 msgid ""
4270 "Adjust the file offset to the next location in the file greater than or "
4271 "equal to I<offset> containing data.  If I<offset> points to data, then the "
4272 "file offset is set to I<offset>."
4273 msgstr ""
4274
4275 #. type: TP
4276 #: build/C/man2/lseek.2:104
4277 #, no-wrap
4278 msgid "B<SEEK_HOLE>"
4279 msgstr ""
4280
4281 #. type: Plain text
4282 #: build/C/man2/lseek.2:118
4283 msgid ""
4284 "Adjust the file offset to the next hole in the file greater than or equal to "
4285 "I<offset>.  If I<offset> points into the middle of a hole, then the file "
4286 "offset is set to I<offset>.  If there is no hole past I<offset>, then the "
4287 "file offset is adjusted to the end of the file (i.e., there is an implicit "
4288 "hole at the end of any file)."
4289 msgstr ""
4290
4291 #. type: Plain text
4292 #: build/C/man2/lseek.2:124
4293 msgid ""
4294 "In both of the above cases, B<lseek>()  fails if I<offset> points past the "
4295 "end of the file."
4296 msgstr ""
4297
4298 #. type: Plain text
4299 #: build/C/man2/lseek.2:130
4300 msgid ""
4301 "These operations allow applications to map holes in a sparsely allocated "
4302 "file.  This can be useful for applications such as file backup tools, which "
4303 "can save space when creating backups and preserve holes, if they have a "
4304 "mechanism for discovering holes."
4305 msgstr ""
4306
4307 #.  https://lkml.org/lkml/2011/4/22/79
4308 #.  http://lwn.net/Articles/440255/
4309 #.  http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
4310 #. type: Plain text
4311 #: build/C/man2/lseek.2:153
4312 msgid ""
4313 "For the purposes of these operations, a hole is a sequence of zeros that "
4314 "(normally) has not been allocated in the underlying file storage.  However, "
4315 "a file system is not obliged to report holes, so these operations are not a "
4316 "guaranteed mechanism for mapping the storage space actually allocated to a "
4317 "file.  (Furthermore, a sequence of zeros that actually has been written to "
4318 "the underlying storage may not be reported as a hole.)  In the simplest "
4319 "implementation, a file system can support the operations by making "
4320 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
4321 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
4322 "by I<offset> is a hole, it can be considered to consist of data that is a "
4323 "sequence of zeros)."
4324 msgstr ""
4325
4326 #. type: Plain text
4327 #: build/C/man2/lseek.2:161
4328 msgid ""
4329 "Upon successful completion, B<lseek>()  returns the resulting offset "
4330 "location as measured in bytes from the beginning of the file.  On error, the "
4331 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
4332 msgstr ""
4333
4334 #.  Some systems may allow negative offsets for character devices
4335 #.  and/or for remote file systems.
4336 #. type: Plain text
4337 #: build/C/man2/lseek.2:174
4338 msgid ""
4339 "I<whence> is not valid.  Or: the resulting file offset would be negative, or "
4340 "beyond the end of a seekable device."
4341 msgstr ""
4342
4343 #. type: TP
4344 #: build/C/man2/lseek.2:174 build/C/man2/open.2:584
4345 #, no-wrap
4346 msgid "B<EOVERFLOW>"
4347 msgstr ""
4348
4349 #.  HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
4350 #. type: Plain text
4351 #: build/C/man2/lseek.2:179
4352 msgid "The resulting file offset cannot be represented in an I<off_t>."
4353 msgstr ""
4354
4355 #. type: TP
4356 #: build/C/man2/lseek.2:179
4357 #, no-wrap
4358 msgid "B<ESPIPE>"
4359 msgstr ""
4360
4361 #. type: Plain text
4362 #: build/C/man2/lseek.2:183
4363 msgid "I<fd> is associated with a pipe, socket, or FIFO."
4364 msgstr ""
4365
4366 #. type: TP
4367 #: build/C/man2/lseek.2:183 build/C/man2/open.2:578
4368 #, no-wrap
4369 msgid "B<ENXIO>"
4370 msgstr ""
4371
4372 #. type: Plain text
4373 #: build/C/man2/lseek.2:191
4374 msgid ""
4375 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
4376 "beyond the end of the file."
4377 msgstr ""
4378
4379 #.  SVr4 documents additional error
4380 #.  conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
4381 #. type: Plain text
4382 #: build/C/man2/lseek.2:193 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
4383 msgid "SVr4, 4.3BSD, POSIX.1-2001."
4384 msgstr ""
4385
4386 #.  FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
4387 #. type: Plain text
4388 #: build/C/man2/lseek.2:201
4389 msgid ""
4390 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
4391 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
4392 "next POSIX revision (Issue 8)."
4393 msgstr ""
4394
4395 #. type: Plain text
4396 #: build/C/man2/lseek.2:205
4397 msgid ""
4398 "Some devices are incapable of seeking and POSIX does not specify which "
4399 "devices must support B<lseek>()."
4400 msgstr ""
4401
4402 #.  Other systems return the number of written characters,
4403 #.  using SEEK_SET to set the counter. (Of written characters.)
4404 #. type: Plain text
4405 #: build/C/man2/lseek.2:212
4406 msgid "On Linux, using B<lseek>()  on a terminal device returns B<ESPIPE>."
4407 msgstr ""
4408
4409 #. type: Plain text
4410 #: build/C/man2/lseek.2:215
4411 msgid ""
4412 "When converting old code, substitute values for I<whence> with the following "
4413 "macros:"
4414 msgstr ""
4415
4416 #. type: tbl table
4417 #: build/C/man2/lseek.2:218
4418 #, no-wrap
4419 msgid "old\tnew\n"
4420 msgstr ""
4421
4422 #. type: tbl table
4423 #: build/C/man2/lseek.2:219
4424 #, no-wrap
4425 msgid "0\tSEEK_SET\n"
4426 msgstr ""
4427
4428 #. type: tbl table
4429 #: build/C/man2/lseek.2:220
4430 #, no-wrap
4431 msgid "1\tSEEK_CUR\n"
4432 msgstr ""
4433
4434 #. type: tbl table
4435 #: build/C/man2/lseek.2:221
4436 #, no-wrap
4437 msgid "2\tSEEK_END\n"
4438 msgstr ""
4439
4440 #. type: tbl table
4441 #: build/C/man2/lseek.2:222
4442 #, no-wrap
4443 msgid "L_SET\tSEEK_SET\n"
4444 msgstr ""
4445
4446 #. type: tbl table
4447 #: build/C/man2/lseek.2:223
4448 #, no-wrap
4449 msgid "L_INCR\tSEEK_CUR\n"
4450 msgstr ""
4451
4452 #. type: tbl table
4453 #: build/C/man2/lseek.2:224
4454 #, no-wrap
4455 msgid "L_XTND\tSEEK_END\n"
4456 msgstr ""
4457
4458 #. type: Plain text
4459 #: build/C/man2/lseek.2:236
4460 msgid ""
4461 "Note that file descriptors created by B<dup>(2)  or B<fork>(2)  share the "
4462 "current file position pointer, so seeking on such files may be subject to "
4463 "race conditions."
4464 msgstr ""
4465
4466 #. type: Plain text
4467 #: build/C/man2/lseek.2:243
4468 msgid ""
4469 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
4470 "B<posix_fallocate>(3)"
4471 msgstr ""
4472
4473 #. type: TH
4474 #: build/C/man3/lseek64.3:25
4475 #, no-wrap
4476 msgid "LSEEK64"
4477 msgstr ""
4478
4479 #. type: TH
4480 #: build/C/man3/lseek64.3:25
4481 #, no-wrap
4482 msgid "2004-12-11"
4483 msgstr ""
4484
4485 #. type: Plain text
4486 #: build/C/man3/lseek64.3:28
4487 msgid "lseek64 - reposition 64-bit read/write file offset"
4488 msgstr ""
4489
4490 #. type: Plain text
4491 #: build/C/man3/lseek64.3:30
4492 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
4493 msgstr ""
4494
4495 #. type: Plain text
4496 #: build/C/man3/lseek64.3:36
4497 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
4498 msgstr ""
4499
4500 #. type: Plain text
4501 #: build/C/man3/lseek64.3:53
4502 msgid ""
4503 "The B<lseek>(2)  family of functions reposition the offset of the open file "
4504 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
4505 "start, current position, or end of the file, when I<whence> has the value "
4506 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
4507 msgstr ""
4508
4509 #. type: Plain text
4510 #: build/C/man3/lseek64.3:56
4511 msgid "For more details, return value, and errors, see B<lseek>(2)."
4512 msgstr ""
4513
4514 #. type: Plain text
4515 #: build/C/man3/lseek64.3:63
4516 msgid ""
4517 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
4518 "the raw system call B<_llseek>(2)."
4519 msgstr ""
4520
4521 #. type: SS
4522 #: build/C/man3/lseek64.3:63
4523 #, no-wrap
4524 msgid "lseek"
4525 msgstr ""
4526
4527 #. type: Plain text
4528 #: build/C/man3/lseek64.3:65 build/C/man3/lseek64.3:87 build/C/man3/lseek64.3:116
4529 msgid "Prototype:"
4530 msgstr ""
4531
4532 #. type: Plain text
4533 #: build/C/man3/lseek64.3:69
4534 #, no-wrap
4535 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4536 msgstr ""
4537
4538 #. type: Plain text
4539 #: build/C/man3/lseek64.3:77
4540 msgid ""
4541 "B<lseek>(2)  uses the type I<off_t>.  This is a 32-bit signed type on 32-bit "
4542 "architectures, unless one compiles with"
4543 msgstr ""
4544
4545 #. type: Plain text
4546 #: build/C/man3/lseek64.3:85
4547 msgid "in which case it is a 64-bit signed type."
4548 msgstr ""
4549
4550 #. type: SS
4551 #: build/C/man3/lseek64.3:85
4552 #, no-wrap
4553 msgid "lseek64"
4554 msgstr ""
4555
4556 #. type: Plain text
4557 #: build/C/man3/lseek64.3:91
4558 #, no-wrap
4559 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
4560 msgstr ""
4561
4562 #. type: Plain text
4563 #: build/C/man3/lseek64.3:102
4564 msgid ""
4565 "The library routine B<lseek64>()  uses a 64-bit type even when I<off_t> is a "
4566 "32-bit type.  Its prototype (and the type I<off64_t>)  is available only "
4567 "when one compiles with"
4568 msgstr ""
4569
4570 #. type: Plain text
4571 #: build/C/man3/lseek64.3:106
4572 #, no-wrap
4573 msgid "#define _LARGEFILE64_SOURCE\n"
4574 msgstr ""
4575
4576 #.  in glibc 2.0.94, not in 2.0.6
4577 #. type: Plain text
4578 #: build/C/man3/lseek64.3:114
4579 msgid ""
4580 "The function B<lseek64>()  is available since glibc 2.1, and is defined to "
4581 "be an alias for B<llseek>()."
4582 msgstr ""
4583
4584 #. type: SS
4585 #: build/C/man3/lseek64.3:114
4586 #, no-wrap
4587 msgid "llseek"
4588 msgstr ""
4589
4590 #. type: Plain text
4591 #: build/C/man3/lseek64.3:120
4592 #, no-wrap
4593 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
4594 msgstr ""
4595
4596 #.  in libc 5.0.9, not in 4.7.6
4597 #. type: Plain text
4598 #: build/C/man3/lseek64.3:139
4599 msgid ""
4600 "The type I<loff_t> is a 64-bit signed type.  The library routine B<llseek>()  "
4601 "is available in libc5 and glibc and works without special defines.  Its "
4602 "prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but glibc does not "
4603 "provide a prototype.  This is bad, since a prototype is needed.  Users "
4604 "should add the above prototype, or something equivalent, to their own "
4605 "source.  When users complained about data loss caused by a miscompilation of "
4606 "B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
4607 msgstr ""
4608
4609 #. type: Plain text
4610 #: build/C/man3/lseek64.3:142
4611 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
4612 msgstr ""
4613
4614 #. type: Plain text
4615 #: build/C/man3/lseek64.3:146
4616 msgid "This makes this function unusable if one desires a warning-free compilation."
4617 msgstr ""
4618
4619 #. type: SS
4620 #: build/C/man3/lseek64.3:146
4621 #, no-wrap
4622 msgid "_llseek"
4623 msgstr ""
4624
4625 #. type: Plain text
4626 #: build/C/man3/lseek64.3:149
4627 msgid ""
4628 "All the above functions are implemented in terms of this system call.  The "
4629 "prototype is:"
4630 msgstr ""
4631
4632 #. type: Plain text
4633 #: build/C/man3/lseek64.3:154
4634 #, no-wrap
4635 msgid ""
4636 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
4637 "B<            loff_t *>I<result>B<, int >I<whence>B<);>\n"
4638 msgstr ""
4639
4640 #. type: Plain text
4641 #: build/C/man3/lseek64.3:159
4642 msgid "For more details, see B<llseek>(2)."
4643 msgstr ""
4644
4645 #. type: Plain text
4646 #: build/C/man3/lseek64.3:162
4647 msgid "B<llseek>(2), B<lseek>(2)"
4648 msgstr ""
4649
4650 #. type: TH
4651 #: build/C/man2/open.2:52
4652 #, no-wrap
4653 msgid "OPEN"
4654 msgstr ""
4655
4656 #. type: TH
4657 #: build/C/man2/open.2:52
4658 #, no-wrap
4659 msgid "2013-02-18"
4660 msgstr ""
4661
4662 #. type: Plain text
4663 #: build/C/man2/open.2:55
4664 msgid "open, creat - open and possibly create a file or device"
4665 msgstr ""
4666
4667 #. type: Plain text
4668 #: build/C/man2/open.2:60
4669 #, no-wrap
4670 msgid ""
4671 "B<#include E<lt>sys/types.hE<gt>>\n"
4672 "B<#include E<lt>sys/stat.hE<gt>>\n"
4673 "B<#include E<lt>fcntl.hE<gt>>\n"
4674 msgstr ""
4675
4676 #. type: Plain text
4677 #: build/C/man2/open.2:63
4678 #, no-wrap
4679 msgid ""
4680 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
4681 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t "
4682 ">I<mode>B<);>\n"
4683 msgstr ""
4684
4685 #. type: Plain text
4686 #: build/C/man2/open.2:65
4687 #, no-wrap
4688 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
4689 msgstr ""
4690
4691 #. type: Plain text
4692 #: build/C/man2/open.2:76
4693 msgid ""
4694 "Given a I<pathname> for a file, B<open>()  returns a file descriptor, a "
4695 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
4696 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.).  The file descriptor returned "
4697 "by a successful call will be the lowest-numbered file descriptor not "
4698 "currently open for the process."
4699 msgstr ""
4700
4701 #. type: Plain text
4702 #: build/C/man2/open.2:88
4703 msgid ""
4704 "By default, the new file descriptor is set to remain open across an "
4705 "B<execve>(2)  (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
4706 "B<fcntl>(2)  is initially disabled; the B<O_CLOEXEC> flag, described below, "
4707 "can be used to change this default).  The file offset is set to the "
4708 "beginning of the file (see B<lseek>(2))."
4709 msgstr ""
4710
4711 #. type: Plain text
4712 #: build/C/man2/open.2:107
4713 msgid ""
4714 "A call to B<open>()  creates a new I<open file description>, an entry in the "
4715 "system-wide table of open files.  This entry records the file offset and the "
4716 "file status flags (modifiable via the B<fcntl>(2)  B<F_SETFL> operation).  A "
4717 "file descriptor is a reference to one of these entries; this reference is "
4718 "unaffected if I<pathname> is subsequently removed or modified to refer to a "
4719 "different file.  The new open file description is initially not shared with "
4720 "any other process, but sharing may arise via B<fork>(2)."
4721 msgstr ""
4722
4723 #. type: Plain text
4724 #: build/C/man2/open.2:115
4725 msgid ""
4726 "The argument I<flags> must include one of the following I<access modes>: "
4727 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>.  These request opening the file "
4728 "read-only, write-only, or read/write, respectively."
4729 msgstr ""
4730
4731 #.  SUSv4 divides the flags into:
4732 #.  * Access mode
4733 #.  * File creation
4734 #.  * File status
4735 #.  * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
4736 #.  though it's not clear what the difference between "other" and
4737 #.  "File creation" flags is.  I raised an Aardvark to see if this
4738 #.  can be clarified in SUSv4; 10 Oct 2008.
4739 #.  http://thread.gmane.org/gmane.comp.standards.posix.austin.general/64/focus=67
4740 #.  TC1 (balloted in 2013), resolved this, so that those three constants
4741 #.  are also categorized" as file status flags.
4742 #. type: Plain text
4743 #: build/C/man2/open.2:153
4744 msgid ""
4745 "In addition, zero or more file creation flags and file status flags can be "
4746 "bitwise-I<or>'d in I<flags>.  The I<file creation flags> are B<O_CLOEXEC>, "
4747 "B<O_CREAT>, B<O_DIRECTORY>, B<O_EXCL>, B<O_NOCTTY>, B<O_NOFOLLOW>, "
4748 "B<O_TRUNC>, and B<O_TTY_INIT>.  The I<file status flags> are all of the "
4749 "remaining flags listed below.  The distinction between these two groups of "
4750 "flags is that the file status flags can be retrieved and (in some cases)  "
4751 "modified using B<fcntl>(2).  The full list of file creation flags and file "
4752 "status flags is as follows:"
4753 msgstr ""
4754
4755 #. type: TP
4756 #: build/C/man2/open.2:153
4757 #, no-wrap
4758 msgid "B<O_APPEND>"
4759 msgstr ""
4760
4761 #.  For more background, see
4762 #.  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
4763 #.  http://nfs.sourceforge.net/
4764 #. type: Plain text
4765 #: build/C/man2/open.2:170
4766 msgid ""
4767 "The file is opened in append mode.  Before each B<write>(2), the file offset "
4768 "is positioned at the end of the file, as if with B<lseek>(2).  B<O_APPEND> "
4769 "may lead to corrupted files on NFS file systems if more than one process "
4770 "appends data to a file at once.  This is because NFS does not support "
4771 "appending to a file, so the client kernel has to simulate it, which can't be "
4772 "done without a race condition."
4773 msgstr ""
4774
4775 #. type: TP
4776 #: build/C/man2/open.2:170
4777 #, no-wrap
4778 msgid "B<O_ASYNC>"
4779 msgstr ""
4780
4781 #. type: Plain text
4782 #: build/C/man2/open.2:183
4783 msgid ""
4784 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
4785 "can be changed via B<fcntl>(2))  when input or output becomes possible on "
4786 "this file descriptor.  This feature is only available for terminals, "
4787 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs.  See "
4788 "B<fcntl>(2)  for further details."
4789 msgstr ""
4790
4791 #. type: TP
4792 #: build/C/man2/open.2:183
4793 #, no-wrap
4794 msgid "B<O_CLOEXEC> (Since Linux 2.6.23)"
4795 msgstr ""
4796
4797 #.  This flag fixes only one form of the race condition;
4798 #.  The race can also occur with, for example, descriptors
4799 #.  returned by accept(), pipe(), etc.
4800 #. type: Plain text
4801 #: build/C/man2/open.2:208
4802 msgid ""
4803 "Enable the close-on-exec flag for the new file descriptor.  Specifying this "
4804 "flag permits a program to avoid additional B<fcntl>(2)  B<F_SETFD> "
4805 "operations to set the B<FD_CLOEXEC> flag.  Additionally, use of this flag is "
4806 "essential in some multithreaded programs since using a separate B<fcntl>(2)  "
4807 "B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not suffice to avoid "
4808 "race conditions where one thread opens a file descriptor at the same time as "
4809 "another thread does a B<fork>(2)  plus B<execve>(2)."
4810 msgstr ""
4811
4812 #. type: TP
4813 #: build/C/man2/open.2:208
4814 #, no-wrap
4815 msgid "B<O_CREAT>"
4816 msgstr ""
4817
4818 #.  As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
4819 #.  XFS (since 2.6.14).
4820 #. type: Plain text
4821 #: build/C/man2/open.2:224
4822 msgid ""
4823 "If the file does not exist it will be created.  The owner (user ID) of the "
4824 "file is set to the effective user ID of the process.  The group ownership "
4825 "(group ID) is set either to the effective group ID of the process or to the "
4826 "group ID of the parent directory (depending on file system type and mount "
4827 "options, and the mode of the parent directory, see the mount options "
4828 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
4829 msgstr ""
4830
4831 #. type: Plain text
4832 #: build/C/man2/open.2:247
4833 msgid ""
4834 "I<mode> specifies the permissions to use in case a new file is created.  "
4835 "This argument must be supplied when B<O_CREAT> is specified in I<flags>; if "
4836 "B<O_CREAT> is not specified, then I<mode> is ignored.  The effective "
4837 "permissions are modified by the process's I<umask> in the usual way: The "
4838 "permissions of the created file are I<(mode\\ &\\ ~umask)>.  Note that this "
4839 "mode only applies to future accesses of the newly created file; the "
4840 "B<open>()  call that creates a read-only file may well return a read/write "
4841 "file descriptor."
4842 msgstr ""
4843
4844 #. type: Plain text
4845 #: build/C/man2/open.2:250
4846 msgid "The following symbolic constants are provided for I<mode>:"
4847 msgstr ""
4848
4849 #. type: TP
4850 #: build/C/man2/open.2:250
4851 #, no-wrap
4852 msgid "B<S_IRWXU>"
4853 msgstr ""
4854
4855 #. type: Plain text
4856 #: build/C/man2/open.2:253
4857 msgid "00700 user (file owner) has read, write and execute permission"
4858 msgstr ""
4859
4860 #. type: TP
4861 #: build/C/man2/open.2:253
4862 #, no-wrap
4863 msgid "B<S_IRUSR>"
4864 msgstr ""
4865
4866 #. type: Plain text
4867 #: build/C/man2/open.2:256
4868 msgid "00400 user has read permission"
4869 msgstr ""
4870
4871 #. type: TP
4872 #: build/C/man2/open.2:256
4873 #, no-wrap
4874 msgid "B<S_IWUSR>"
4875 msgstr ""
4876
4877 #. type: Plain text
4878 #: build/C/man2/open.2:259
4879 msgid "00200 user has write permission"
4880 msgstr ""
4881
4882 #. type: TP
4883 #: build/C/man2/open.2:259
4884 #, no-wrap
4885 msgid "B<S_IXUSR>"
4886 msgstr ""
4887
4888 #. type: Plain text
4889 #: build/C/man2/open.2:262
4890 msgid "00100 user has execute permission"
4891 msgstr ""
4892
4893 #. type: TP
4894 #: build/C/man2/open.2:262
4895 #, no-wrap
4896 msgid "B<S_IRWXG>"
4897 msgstr ""
4898
4899 #. type: Plain text
4900 #: build/C/man2/open.2:265
4901 msgid "00070 group has read, write and execute permission"
4902 msgstr ""
4903
4904 #. type: TP
4905 #: build/C/man2/open.2:265
4906 #, no-wrap
4907 msgid "B<S_IRGRP>"
4908 msgstr ""
4909
4910 #. type: Plain text
4911 #: build/C/man2/open.2:268
4912 msgid "00040 group has read permission"
4913 msgstr ""
4914
4915 #. type: TP
4916 #: build/C/man2/open.2:268
4917 #, no-wrap
4918 msgid "B<S_IWGRP>"
4919 msgstr ""
4920
4921 #. type: Plain text
4922 #: build/C/man2/open.2:271
4923 msgid "00020 group has write permission"
4924 msgstr ""
4925
4926 #. type: TP
4927 #: build/C/man2/open.2:271
4928 #, no-wrap
4929 msgid "B<S_IXGRP>"
4930 msgstr ""
4931
4932 #. type: Plain text
4933 #: build/C/man2/open.2:274
4934 msgid "00010 group has execute permission"
4935 msgstr ""
4936
4937 #. type: TP
4938 #: build/C/man2/open.2:274
4939 #, no-wrap
4940 msgid "B<S_IRWXO>"
4941 msgstr ""
4942
4943 #. type: Plain text
4944 #: build/C/man2/open.2:277
4945 msgid "00007 others have read, write and execute permission"
4946 msgstr ""
4947
4948 #. type: TP
4949 #: build/C/man2/open.2:277
4950 #, no-wrap
4951 msgid "B<S_IROTH>"
4952 msgstr ""
4953
4954 #. type: Plain text
4955 #: build/C/man2/open.2:280
4956 msgid "00004 others have read permission"
4957 msgstr ""
4958
4959 #. type: TP
4960 #: build/C/man2/open.2:280
4961 #, no-wrap
4962 msgid "B<S_IWOTH>"
4963 msgstr ""
4964
4965 #. type: Plain text
4966 #: build/C/man2/open.2:283
4967 msgid "00002 others have write permission"
4968 msgstr ""
4969
4970 #. type: TP
4971 #: build/C/man2/open.2:283
4972 #, no-wrap
4973 msgid "B<S_IXOTH>"
4974 msgstr ""
4975
4976 #. type: Plain text
4977 #: build/C/man2/open.2:286
4978 msgid "00001 others have execute permission"
4979 msgstr ""
4980
4981 #. type: TP
4982 #: build/C/man2/open.2:287
4983 #, no-wrap
4984 msgid "B<O_DIRECT> (Since Linux 2.4.10)"
4985 msgstr ""
4986
4987 #. type: Plain text
4988 #: build/C/man2/open.2:304
4989 msgid ""
4990 "Try to minimize cache effects of the I/O to and from this file.  In general "
4991 "this will degrade performance, but it is useful in special situations, such "
4992 "as when applications do their own caching.  File I/O is done directly "
4993 "to/from user-space buffers.  The B<O_DIRECT> flag on its own makes an effort "
4994 "to transfer data synchronously, but does not give the guarantees of the "
4995 "B<O_SYNC> flag that data and necessary metadata are transferred.  To "
4996 "guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
4997 "B<O_DIRECT>.  See NOTES below for further discussion."
4998 msgstr ""
4999
5000 #. type: Plain text
5001 #: build/C/man2/open.2:308
5002 msgid ""
5003 "A semantically similar (but deprecated) interface for block devices is "
5004 "described in B<raw>(8)."
5005 msgstr ""
5006
5007 #. type: TP
5008 #: build/C/man2/open.2:308
5009 #, no-wrap
5010 msgid "B<O_DIRECTORY>"
5011 msgstr ""
5012
5013 #.  But see the following and its replies:
5014 #.  http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
5015 #.  [PATCH] open: O_DIRECTORY and O_CREAT together should fail
5016 #.  O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
5017 #. type: Plain text
5018 #: build/C/man2/open.2:322
5019 msgid ""
5020 "If I<pathname> is not a directory, cause the open to fail.  This flag is "
5021 "Linux-specific, and was added in kernel version 2.1.126, to avoid "
5022 "denial-of-service problems if B<opendir>(3)  is called on a FIFO or tape "
5023 "device, but should not be used outside of the implementation of "
5024 "B<opendir>(3)."
5025 msgstr ""
5026
5027 #. type: TP
5028 #: build/C/man2/open.2:322
5029 #, no-wrap
5030 msgid "B<O_EXCL>"
5031 msgstr ""
5032
5033 #. type: Plain text
5034 #: build/C/man2/open.2:332
5035 msgid ""
5036 "Ensure that this call creates the file: if this flag is specified in "
5037 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>()  "
5038 "will fail."
5039 msgstr ""
5040
5041 #.  POSIX.1-2001 explicitly requires this behavior.
5042 #. type: Plain text
5043 #: build/C/man2/open.2:340
5044 msgid ""
5045 "When these two flags are specified, symbolic links are not followed: if "
5046 "I<pathname> is a symbolic link, then B<open>()  fails regardless of where "
5047 "the symbolic link points to."
5048 msgstr ""
5049
5050 #. type: Plain text
5051 #: build/C/man2/open.2:356
5052 msgid ""
5053 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
5054 "B<O_CREAT>.  There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
5055 "be used without B<O_CREAT> if I<pathname> refers to a block device.  If the "
5056 "block device is in use by the system (e.g., mounted), B<open>()  fails with "
5057 "the error B<EBUSY>."
5058 msgstr ""
5059
5060 #. type: Plain text
5061 #: build/C/man2/open.2:378
5062 msgid ""
5063 "On NFS, B<O_EXCL> is only supported when using NFSv3 or later on kernel 2.6 "
5064 "or later.  In NFS environments where B<O_EXCL> support is not provided, "
5065 "programs that rely on it for performing locking tasks will contain a race "
5066 "condition.  Portable programs that want to perform atomic file locking using "
5067 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
5068 "create a unique file on the same file system (e.g., incorporating hostname "
5069 "and PID), and use B<link>(2)  to make a link to the lockfile.  If B<link>(2)  "
5070 "returns 0, the lock is successful.  Otherwise, use B<stat>(2)  on the unique "
5071 "file to check if its link count has increased to 2, in which case the lock "
5072 "is also successful."
5073 msgstr ""
5074
5075 #. type: TP
5076 #: build/C/man2/open.2:378
5077 #, no-wrap
5078 msgid "B<O_LARGEFILE>"
5079 msgstr ""
5080
5081 #. type: Plain text
5082 #: build/C/man2/open.2:400
5083 msgid ""
5084 "(LFS)  Allow files whose sizes cannot be represented in an I<off_t> (but can "
5085 "be represented in an I<off64_t>)  to be opened.  The B<_LARGEFILE64_SOURCE> "
5086 "macro must be defined (before including I<any> header files)  in order to "
5087 "obtain this definition.  Setting the B<_FILE_OFFSET_BITS> feature test macro "
5088 "to 64 (rather than using B<O_LARGEFILE>)  is the preferred method of "
5089 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
5090 msgstr ""
5091
5092 #. type: TP
5093 #: build/C/man2/open.2:400
5094 #, no-wrap
5095 msgid "B<O_NOATIME> (Since Linux 2.6.8)"
5096 msgstr ""
5097
5098 #.  The O_NOATIME flag also affects the treatment of st_atime
5099 #.  by mmap() and readdir(2), MTK, Dec 04.
5100 #. type: Plain text
5101 #: build/C/man2/open.2:413
5102 msgid ""
5103 "Do not update the file last access time (I<st_atime> in the inode)  when the "
5104 "file is B<read>(2).  This flag is intended for use by indexing or backup "
5105 "programs, where its use can significantly reduce the amount of disk "
5106 "activity.  This flag may not be effective on all file systems.  One example "
5107 "is NFS, where the server maintains the access time."
5108 msgstr ""
5109
5110 #. type: TP
5111 #: build/C/man2/open.2:413
5112 #, no-wrap
5113 msgid "B<O_NOCTTY>"
5114 msgstr ""
5115
5116 #. type: Plain text
5117 #: build/C/man2/open.2:421
5118 msgid ""
5119 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(emit will not "
5120 "become the process's controlling terminal even if the process does not have "
5121 "one."
5122 msgstr ""
5123
5124 #. type: TP
5125 #: build/C/man2/open.2:421
5126 #, no-wrap
5127 msgid "B<O_NOFOLLOW>"
5128 msgstr ""
5129
5130 #.  The headers from glibc 2.0.100 and later include a
5131 #.  definition of this flag; \fIkernels before 2.1.126 will ignore it if
5132 #.  used\fP.
5133 #. type: Plain text
5134 #: build/C/man2/open.2:430
5135 msgid ""
5136 "If I<pathname> is a symbolic link, then the open fails.  This is a FreeBSD "
5137 "extension, which was added to Linux in version 2.1.126.  Symbolic links in "
5138 "earlier components of the pathname will still be followed."
5139 msgstr ""
5140
5141 #. type: TP
5142 #: build/C/man2/open.2:430
5143 #, no-wrap
5144 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
5145 msgstr ""
5146
5147 #. type: Plain text
5148 #: build/C/man2/open.2:443
5149 msgid ""
5150 "When possible, the file is opened in nonblocking mode.  Neither the "
5151 "B<open>()  nor any subsequent operations on the file descriptor which is "
5152 "returned will cause the calling process to wait.  For the handling of FIFOs "
5153 "(named pipes), see also B<fifo>(7).  For a discussion of the effect of "
5154 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
5155 "see B<fcntl>(2)."
5156 msgstr ""
5157
5158 #. type: TP
5159 #: build/C/man2/open.2:443
5160 #, no-wrap
5161 msgid "B<O_SYNC>"
5162 msgstr ""
5163
5164 #. type: Plain text
5165 #: build/C/man2/open.2:451
5166 msgid ""
5167 "The file is opened for synchronous I/O.  Any B<write>(2)s on the resulting "
5168 "file descriptor will block the calling process until the data has been "
5169 "physically written to the underlying hardware.  I<But see NOTES below>."
5170 msgstr ""
5171
5172 #. type: TP
5173 #: build/C/man2/open.2:451
5174 #, no-wrap
5175 msgid "B<O_TRUNC>"
5176 msgstr ""
5177
5178 #. type: Plain text
5179 #: build/C/man2/open.2:465
5180 msgid ""
5181 "If the file already exists and is a regular file and the open mode allows "
5182 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>)  it will be truncated to length "
5183 "0.  If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
5184 "ignored.  Otherwise the effect of B<O_TRUNC> is unspecified."
5185 msgstr ""
5186
5187 #. type: Plain text
5188 #: build/C/man2/open.2:469
5189 msgid ""
5190 "Some of these optional flags can be altered using B<fcntl>(2)  after the "
5191 "file has been opened."
5192 msgstr ""
5193
5194 #. type: Plain text
5195 #: build/C/man2/open.2:477
5196 msgid ""
5197 "B<creat>()  is equivalent to B<open>()  with I<flags> equal to "
5198 "B<O_CREAT|O_WRONLY|O_TRUNC>."
5199 msgstr ""
5200
5201 #. type: Plain text
5202 #: build/C/man2/open.2:485
5203 msgid ""
5204 "B<open>()  and B<creat>()  return the new file descriptor, or -1 if an error "
5205 "occurred (in which case, I<errno> is set appropriately)."
5206 msgstr ""
5207
5208 #. type: Plain text
5209 #: build/C/man2/open.2:495
5210 msgid ""
5211 "The requested access to the file is not allowed, or search permission is "
5212 "denied for one of the directories in the path prefix of I<pathname>, or the "
5213 "file did not exist yet and write access to the parent directory is not "
5214 "allowed.  (See also B<path_resolution>(7).)"
5215 msgstr ""
5216
5217 #. type: Plain text
5218 #: build/C/man2/open.2:501
5219 msgid ""
5220 "Where B<O_CREAT> is specified, the file does not exist, and the user's quota "
5221 "of disk blocks or inodes on the file system has been exhausted."
5222 msgstr ""
5223
5224 #. type: Plain text
5225 #: build/C/man2/open.2:507
5226 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
5227 msgstr ""
5228
5229 #. type: Plain text
5230 #: build/C/man2/open.2:511 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:84
5231 msgid "I<pathname> points outside your accessible address space."
5232 msgstr ""
5233
5234 #. type: TP
5235 #: build/C/man2/open.2:511 build/C/man2/write.2:145
5236 #, no-wrap
5237 msgid "B<EFBIG>"
5238 msgstr ""
5239
5240 #. type: Plain text
5241 #: build/C/man2/open.2:515
5242 msgid "See B<EOVERFLOW>."
5243 msgstr ""
5244
5245 #. type: TP
5246 #: build/C/man2/open.2:515 build/C/man2/read.2:122 build/C/man3/scanf.3:562 build/C/man3/tmpfile.3:61 build/C/man2/write.2:150
5247 #, no-wrap
5248 msgid "B<EINTR>"
5249 msgstr ""
5250
5251 #. type: Plain text
5252 #: build/C/man2/open.2:522
5253 msgid ""
5254 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
5255 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
5256 "B<signal>(7)."
5257 msgstr ""
5258
5259 #. type: TP
5260 #: build/C/man2/open.2:522 build/C/man2/read.2:158 build/C/man2/rename.2:143 build/C/man2/unlink.2:87
5261 #, no-wrap
5262 msgid "B<EISDIR>"
5263 msgstr ""
5264
5265 #. type: Plain text
5266 #: build/C/man2/open.2:531
5267 msgid ""
5268 "I<pathname> refers to a directory and the access requested involved writing "
5269 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
5270 msgstr ""
5271
5272 #. type: Plain text
5273 #: build/C/man2/open.2:538
5274 msgid ""
5275 "Too many symbolic links were encountered in resolving I<pathname>, or "
5276 "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
5277 msgstr ""
5278
5279 #. type: TP
5280 #: build/C/man2/open.2:538 build/C/man2/pipe.2:107 build/C/man3/tmpfile.3:64
5281 #, no-wrap
5282 msgid "B<EMFILE>"
5283 msgstr ""
5284
5285 #. type: Plain text
5286 #: build/C/man2/open.2:541
5287 msgid "The process already has the maximum number of files open."
5288 msgstr ""
5289
5290 #. type: Plain text
5291 #: build/C/man2/open.2:545 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:99
5292 msgid "I<pathname> was too long."
5293 msgstr ""
5294
5295 #. type: TP
5296 #: build/C/man2/open.2:545 build/C/man2/pipe.2:110 build/C/man3/tmpfile.3:67
5297 #, no-wrap
5298 msgid "B<ENFILE>"
5299 msgstr ""
5300
5301 #. type: Plain text
5302 #: build/C/man2/open.2:548 build/C/man2/pipe.2:113
5303 msgid "The system limit on the total number of open files has been reached."
5304 msgstr ""
5305
5306 #. type: TP
5307 #: build/C/man2/open.2:548
5308 #, no-wrap
5309 msgid "B<ENODEV>"
5310 msgstr ""
5311
5312 #. type: Plain text
5313 #: build/C/man2/open.2:555
5314 msgid ""
5315 "I<pathname> refers to a device special file and no corresponding device "
5316 "exists.  (This is a Linux kernel bug; in this situation B<ENXIO> must be "
5317 "returned.)"
5318 msgstr ""
5319
5320 #. type: Plain text
5321 #: build/C/man2/open.2:562
5322 msgid ""
5323 "B<O_CREAT> is not set and the named file does not exist.  Or, a directory "
5324 "component in I<pathname> does not exist or is a dangling symbolic link."
5325 msgstr ""
5326
5327 #. type: Plain text
5328 #: build/C/man2/open.2:571
5329 msgid ""
5330 "I<pathname> was to be created but the device containing I<pathname> has no "
5331 "room for the new file."
5332 msgstr ""
5333
5334 #. type: Plain text
5335 #: build/C/man2/open.2:578
5336 msgid ""
5337 "A component used as a directory in I<pathname> is not, in fact, a directory, "
5338 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
5339 msgstr ""
5340
5341 #. type: Plain text
5342 #: build/C/man2/open.2:584
5343 msgid ""
5344 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO and no process "
5345 "has the file open for reading.  Or, the file is a device special file and no "
5346 "corresponding device exists."
5347 msgstr ""
5348
5349 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=7253
5350 #.  "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
5351 #.  Reported 2006-10-03
5352 #. type: Plain text
5353 #: build/C/man2/open.2:604
5354 msgid ""
5355 "I<pathname> refers to a regular file that is too large to be opened.  The "
5356 "usual scenario here is that an application compiled on a 32-bit platform "
5357 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
5358 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above.  This is the error "
5359 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
5360 "B<EFBIG> for this case."
5361 msgstr ""
5362
5363 #.  Strictly speaking, it's the file system UID... (MTK)
5364 #. type: Plain text
5365 #: build/C/man2/open.2:612
5366 msgid ""
5367 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
5368 "did not match the owner of the file and the caller was not privileged "
5369 "(B<CAP_FOWNER>)."
5370 msgstr ""
5371
5372 #. type: Plain text
5373 #: build/C/man2/open.2:617
5374 msgid ""
5375 "I<pathname> refers to a file on a read-only file system and write access was "
5376 "requested."
5377 msgstr ""
5378
5379 #. type: TP
5380 #: build/C/man2/open.2:617
5381 #, no-wrap
5382 msgid "B<ETXTBSY>"
5383 msgstr ""
5384
5385 #. type: Plain text
5386 #: build/C/man2/open.2:622
5387 msgid ""
5388 "I<pathname> refers to an executable image which is currently being executed "
5389 "and write access was requested."
5390 msgstr ""
5391
5392 #. type: TP
5393 #: build/C/man2/open.2:622
5394 #, no-wrap
5395 msgid "B<EWOULDBLOCK>"
5396 msgstr ""
5397
5398 #. type: Plain text
5399 #: build/C/man2/open.2:629
5400 msgid ""
5401 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
5402 "the file (see B<fcntl>(2))."
5403 msgstr ""
5404
5405 #. type: Plain text
5406 #: build/C/man2/open.2:642
5407 msgid ""
5408 "SVr4, 4.3BSD, POSIX.1-2001.  The B<O_DIRECTORY>, B<O_NOATIME>, and "
5409 "B<O_NOFOLLOW> flags are Linux-specific, and one may need to define "
5410 "B<_GNU_SOURCE> (before including I<any> header files)  to obtain their "
5411 "definitions."
5412 msgstr ""
5413
5414 #. type: Plain text
5415 #: build/C/man2/open.2:647
5416 msgid ""
5417 "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified in "
5418 "POSIX.1-2008."
5419 msgstr ""
5420
5421 #. type: Plain text
5422 #: build/C/man2/open.2:655
5423 msgid ""
5424 "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
5425 "(before including I<any> header files)  to get its definition."
5426 msgstr ""
5427
5428 #. type: Plain text
5429 #: build/C/man2/open.2:663
5430 msgid ""
5431 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
5432 "does not necessarily have the intention to read or write.  This is typically "
5433 "used to open devices in order to get a file descriptor for use with "
5434 "B<ioctl>(2)."
5435 msgstr ""
5436
5437 #.  See for example util-linux's disk-utils/setfdprm.c
5438 #.  For some background on access mode 3, see
5439 #.  http://thread.gmane.org/gmane.linux.kernel/653123
5440 #.  "[RFC] correct flags to f_mode conversion in __dentry_open"
5441 #.  LKML, 12 Mar 2008
5442 #. type: Plain text
5443 #: build/C/man2/open.2:692
5444 msgid ""
5445 "Unlike the other values that can be specified in I<flags>, the I<access "
5446 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR>, do not specify "
5447 "individual bits.  Rather, they define the low order two bits of I<flags>, "
5448 "and are defined respectively as 0, 1, and 2.  In other words, the "
5449 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
5450 "not have the same meaning as B<O_RDWR>.  Linux reserves the special, "
5451 "nonstandard access mode 3 (binary 11) in I<flags> to mean: check for read "
5452 "and write permission on the file and return a descriptor that can't be used "
5453 "for reading or writing.  This nonstandard access mode is used by some Linux "
5454 "drivers to return a descriptor that is only to be used for device-specific "
5455 "B<ioctl>(2)  operations."
5456 msgstr ""
5457
5458 #.  Linux 2.0, 2.5: truncate
5459 #.  Solaris 5.7, 5.8: truncate
5460 #.  Irix 6.5: truncate
5461 #.  Tru64 5.1B: truncate
5462 #.  HP-UX 11.22: truncate
5463 #.  FreeBSD 4.7: truncate
5464 #. type: Plain text
5465 #: build/C/man2/open.2:703
5466 msgid ""
5467 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
5468 "implementations.  On many systems the file is actually truncated."
5469 msgstr ""
5470
5471 #. type: Plain text
5472 #: build/C/man2/open.2:707
5473 msgid ""
5474 "There are many infelicities in the protocol underlying NFS, affecting "
5475 "amongst others B<O_SYNC> and B<O_NDELAY>."
5476 msgstr ""
5477
5478 #. type: Plain text
5479 #: build/C/man2/open.2:729
5480 msgid ""
5481 "POSIX provides for three different variants of synchronized I/O, "
5482 "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>.  Currently "
5483 "(2.6.31), Linux only implements B<O_SYNC>, but glibc maps B<O_DSYNC> and "
5484 "B<O_RSYNC> to the same numerical value as B<O_SYNC>.  Most Linux file "
5485 "systems don't actually implement the POSIX B<O_SYNC> semantics, which "
5486 "require all metadata updates of a write to be on disk on returning to user "
5487 "space, but only the B<O_DSYNC> semantics, which require only actual file "
5488 "data and metadata necessary to retrieve it to be on disk by the time the "
5489 "system call returns."
5490 msgstr ""
5491
5492 #. type: Plain text
5493 #: build/C/man2/open.2:737
5494 msgid ""
5495 "Note that B<open>()  can open device special files, but B<creat>()  cannot "
5496 "create them; use B<mknod>(2)  instead."
5497 msgstr ""
5498
5499 #. type: Plain text
5500 #: build/C/man2/open.2:750
5501 msgid ""
5502 "On NFS file systems with UID mapping enabled, B<open>()  may return a file "
5503 "descriptor but, for example, B<read>(2)  requests are denied with "
5504 "B<EACCES>.  This is because the client performs B<open>()  by checking the "
5505 "permissions, but UID mapping is performed by the server upon read and write "
5506 "requests."
5507 msgstr ""
5508
5509 #. type: Plain text
5510 #: build/C/man2/open.2:769
5511 msgid ""
5512 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
5513 "fields (respectively, time of last access, time of last status change, and "
5514 "time of last modification; see B<stat>(2))  are set to the current time, and "
5515 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory.  "
5516 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
5517 "st_ctime and st_mtime fields are set to the current time."
5518 msgstr ""
5519
5520 #. type: SS
5521 #: build/C/man2/open.2:769
5522 #, no-wrap
5523 msgid "O_DIRECT"
5524 msgstr ""
5525
5526 #. type: Plain text
5527 #: build/C/man2/open.2:786
5528 msgid ""
5529 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
5530 "address of user-space buffers and the file offset of I/Os.  In Linux "
5531 "alignment restrictions vary by file system and kernel version and might be "
5532 "absent entirely.  However there is currently no file system-independent "
5533 "interface for an application to discover these restrictions for a given file "
5534 "or file system.  Some file systems provide their own interfaces for doing "
5535 "so, for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
5536 msgstr ""
5537
5538 #. type: Plain text
5539 #: build/C/man2/open.2:791
5540 msgid ""
5541 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
5542 "the file offset must all be multiples of the logical block size of the file "
5543 "system.  Under Linux 2.6, alignment to 512-byte boundaries suffices."
5544 msgstr ""
5545
5546 #. type: Plain text
5547 #: build/C/man2/open.2:825
5548 msgid ""
5549 "B<O_DIRECT> I/Os should never be run concurrently with the B<fork>(2)  "
5550 "system call, if the memory buffer is a private mapping (i.e., any mapping "
5551 "created with the B<mmap>(2)  B<MAP_PRIVATE> flag; this includes memory "
5552 "allocated on the heap and statically allocated buffers).  Any such I/Os, "
5553 "whether submitted via an asynchronous I/O interface or from another thread "
5554 "in the process, should be completed before B<fork>(2)  is called.  Failure "
5555 "to do so can result in data corruption and undefined behavior in parent and "
5556 "child processes.  This restriction does not apply when the memory buffer for "
5557 "the B<O_DIRECT> I/Os was created using B<shmat>(2)  or B<mmap>(2)  with the "
5558 "B<MAP_SHARED> flag.  Nor does this restriction apply when the memory buffer "
5559 "has been advised as B<MADV_DONTFORK> with B<madvise>(2), ensuring that it "
5560 "will not be available to the child after B<fork>(2)."
5561 msgstr ""
5562
5563 #. type: Plain text
5564 #: build/C/man2/open.2:835
5565 msgid ""
5566 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
5567 "restrictions similar to those of Linux 2.4.  IRIX has also a B<fcntl>(2)  "
5568 "call to query appropriate alignments, and sizes.  FreeBSD 4.x introduced a "
5569 "flag of the same name, but without alignment restrictions."
5570 msgstr ""
5571
5572 #. type: Plain text
5573 #: build/C/man2/open.2:844
5574 msgid ""
5575 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10.  Older "
5576 "Linux kernels simply ignore this flag.  Some file systems may not implement "
5577 "the flag and B<open>()  will fail with B<EINVAL> if it is used."
5578 msgstr ""
5579
5580 #. type: Plain text
5581 #: build/C/man2/open.2:855
5582 msgid ""
5583 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
5584 "file, and especially to overlapping byte regions in the same file.  Even "
5585 "when the file system correctly handles the coherency issues in this "
5586 "situation, overall I/O throughput is likely to be slower than using either "
5587 "mode alone.  Likewise, applications should avoid mixing B<mmap>(2)  of files "
5588 "with direct I/O to the same files."
5589 msgstr ""
5590
5591 #. type: Plain text
5592 #: build/C/man2/open.2:877
5593 msgid ""
5594 "The behaviour of B<O_DIRECT> with NFS will differ from local file systems.  "
5595 "Older kernels, or kernels configured in certain ways, may not support this "
5596 "combination.  The NFS protocol does not support passing the flag to the "
5597 "server, so B<O_DIRECT> I/O will only bypass the page cache on the client; "
5598 "the server may still cache the I/O.  The client asks the server to make the "
5599 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>.  Some "
5600 "servers will perform poorly under these circumstances, especially if the I/O "
5601 "size is small.  Some servers may also be configured to lie to clients about "
5602 "the I/O having reached stable storage; this will avoid the performance "
5603 "penalty at some risk to data integrity in the event of server power "
5604 "failure.  The Linux NFS client places no alignment restrictions on "
5605 "B<O_DIRECT> I/O."
5606 msgstr ""
5607
5608 #. type: Plain text
5609 #: build/C/man2/open.2:884
5610 msgid ""
5611 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
5612 "with caution.  It is recommended that applications treat use of B<O_DIRECT> "
5613 "as a performance option which is disabled by default."
5614 msgstr ""
5615
5616 #. type: Plain text
5617 #: build/C/man2/open.2:889
5618 msgid ""
5619 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
5620 "interface is just stupid, and was probably designed by a deranged monkey on "
5621 "some serious mind-controlling substances.\"\\(emLinus"
5622 msgstr ""
5623
5624 #.  FIXME . Check bugzilla report on open(O_ASYNC)
5625 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=5993
5626 #. type: Plain text
5627 #: build/C/man2/open.2:901
5628 msgid ""
5629 "Currently, it is not possible to enable signal-driven I/O by specifying "
5630 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2)  to enable this flag."
5631 msgstr ""
5632
5633 #. type: Plain text
5634 #: build/C/man2/open.2:923
5635 msgid ""
5636 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
5637 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<openat>(2), B<read>(2), "
5638 "B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), B<write>(2), "
5639 "B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
5640 msgstr ""
5641
5642 #. type: TH
5643 #: build/C/man3/perror.3:31
5644 #, no-wrap
5645 msgid "PERROR"
5646 msgstr ""
5647
5648 #. type: TH
5649 #: build/C/man3/perror.3:31
5650 #, no-wrap
5651 msgid "2012-04-17"
5652 msgstr ""
5653
5654 #. type: Plain text
5655 #: build/C/man3/perror.3:34
5656 msgid "perror - print a system error message"
5657 msgstr ""
5658
5659 #. type: Plain text
5660 #: build/C/man3/perror.3:38
5661 msgid "B<void perror(const char *>I<s>B<);>"
5662 msgstr ""
5663
5664 #. type: Plain text
5665 #: build/C/man3/perror.3:40
5666 msgid "B<#include E<lt>errno.hE<gt>>"
5667 msgstr ""
5668
5669 #. type: Plain text
5670 #: build/C/man3/perror.3:42
5671 msgid "B<const char *>I<sys_errlist>B<[];>"
5672 msgstr ""
5673
5674 #. type: Plain text
5675 #: build/C/man3/perror.3:44
5676 msgid "B<int >I<sys_nerr>B<;>"
5677 msgstr ""
5678
5679 #. type: Plain text
5680 #: build/C/man3/perror.3:46
5681 msgid "B<int >I<errno>B<;>"
5682 msgstr ""
5683
5684 #. type: Plain text
5685 #: build/C/man3/perror.3:55
5686 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
5687 msgstr ""
5688
5689 #. type: Plain text
5690 #: build/C/man3/perror.3:68
5691 msgid ""
5692 "The routine B<perror>()  produces a message on the standard error output, "
5693 "describing the last error encountered during a call to a system or library "
5694 "function.  First (if I<s> is not NULL and I<*s> is not a null byte "
5695 "(\\(aq\\e0\\(aq)) the argument string I<s> is printed, followed by a colon "
5696 "and a blank.  Then the message and a new-line."
5697 msgstr ""
5698
5699 #. type: Plain text
5700 #: build/C/man3/perror.3:76
5701 msgid ""
5702 "To be of most use, the argument string should include the name of the "
5703 "function that incurred the error.  The error number is taken from the "
5704 "external variable I<errno>, which is set when errors occur but not cleared "
5705 "when successful calls are made."
5706 msgstr ""
5707
5708 #. type: Plain text
5709 #: build/C/man3/perror.3:90
5710 msgid ""
5711 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
5712 "obtain the error message without the newline.  The largest message number "
5713 "provided in the table is I<sys_nerr>-1.  Be careful when directly accessing "
5714 "this list because new error values may not have been added to "
5715 "I<sys_errlist>[].  The use of I<sys_errlist>[] is nowadays deprecated."
5716 msgstr ""
5717
5718 #. type: Plain text
5719 #: build/C/man3/perror.3:111
5720 msgid ""
5721 "When a system call fails, it usually returns -1 and sets the variable "
5722 "I<errno> to a value describing what went wrong.  (These values can be found "
5723 "in I<E<lt>errno.hE<gt>>.)  Many library functions do likewise.  The function "
5724 "B<perror>()  serves to translate this error code into human-readable form.  "
5725 "Note that I<errno> is undefined after a successful library call: this call "
5726 "may well change this variable, even though it succeeds, for example because "
5727 "it internally used some other library function that failed.  Thus, if a "
5728 "failing call is not immediately followed by a call to B<perror>(), the value "
5729 "of I<errno> should be saved."
5730 msgstr ""
5731
5732 #. type: Plain text
5733 #: build/C/man3/perror.3:124
5734 msgid ""
5735 "The function B<perror>()  and the external I<errno> (see B<errno>(3))  "
5736 "conform to C89, C99, 4.3BSD, POSIX.1-2001.  The externals I<sys_nerr> and "
5737 "I<sys_errlist> conform to BSD."
5738 msgstr ""
5739
5740 #.  and only when _BSD_SOURCE is defined.
5741 #.  When
5742 #.  .B _GNU_SOURCE
5743 #.  is defined, the symbols
5744 #.  .I _sys_nerr
5745 #.  and
5746 #.  .I _sys_errlist
5747 #.  are provided.
5748 #. type: Plain text
5749 #: build/C/man3/perror.3:139
5750 msgid ""
5751 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
5752 "I<E<lt>stdio.hE<gt>>."
5753 msgstr ""
5754
5755 #. type: Plain text
5756 #: build/C/man3/perror.3:144
5757 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
5758 msgstr ""
5759
5760 #. type: TH
5761 #: build/C/man2/pipe.2:36
5762 #, no-wrap
5763 msgid "PIPE"
5764 msgstr ""
5765
5766 #. type: TH
5767 #: build/C/man2/pipe.2:36
5768 #, no-wrap
5769 msgid "2012-02-14"
5770 msgstr ""
5771
5772 #. type: Plain text
5773 #: build/C/man2/pipe.2:39
5774 msgid "pipe, pipe2 - create pipe"
5775 msgstr ""
5776
5777 #. type: Plain text
5778 #: build/C/man2/pipe.2:42 build/C/man2/read.2:41
5779 #, no-wrap
5780 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5781 msgstr ""
5782
5783 #. type: Plain text
5784 #: build/C/man2/pipe.2:44
5785 #, no-wrap
5786 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
5787 msgstr ""
5788
5789 #. type: Plain text
5790 #: build/C/man2/pipe.2:48
5791 #, no-wrap
5792 msgid ""
5793 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
5794 "B<#include E<lt>fcntl.hE<gt>>              /* Obtain O_* constant "
5795 "definitions */\n"
5796 "B<#include E<lt>unistd.hE<gt>>\n"
5797 msgstr ""
5798
5799 #. type: Plain text
5800 #: build/C/man2/pipe.2:50
5801 #, no-wrap
5802 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
5803 msgstr ""
5804
5805 #. type: Plain text
5806 #: build/C/man2/pipe.2:66
5807 msgid ""
5808 "B<pipe>()  creates a pipe, a unidirectional data channel that can be used "
5809 "for interprocess communication.  The array I<pipefd> is used to return two "
5810 "file descriptors referring to the ends of the pipe.  I<pipefd[0]> refers to "
5811 "the read end of the pipe.  I<pipefd[1]> refers to the write end of the "
5812 "pipe.  Data written to the write end of the pipe is buffered by the kernel "
5813 "until it is read from the read end of the pipe.  For further details, see "
5814 "B<pipe>(7)."
5815 msgstr ""
5816
5817 #. type: Plain text
5818 #: build/C/man2/pipe.2:76
5819 msgid ""
5820 "If I<flags> is 0, then B<pipe2>()  is the same as B<pipe>().  The following "
5821 "values can be bitwise ORed in I<flags> to obtain different behavior:"
5822 msgstr ""
5823
5824 #. type: TP
5825 #: build/C/man2/pipe.2:76
5826 #, no-wrap
5827 msgid "B<O_NONBLOCK>"
5828 msgstr ""
5829
5830 #. type: Plain text
5831 #: build/C/man2/pipe.2:84
5832 msgid ""
5833 "Set the B<O_NONBLOCK> file status flag on the two new open file "
5834 "descriptions.  Using this flag saves extra calls to B<fcntl>(2)  to achieve "
5835 "the same result."
5836 msgstr ""
5837
5838 #. type: TP
5839 #: build/C/man2/pipe.2:84
5840 #, no-wrap
5841 msgid "B<O_CLOEXEC>"
5842 msgstr ""
5843
5844 #. type: Plain text
5845 #: build/C/man2/pipe.2:92
5846 msgid ""
5847 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the two new file "
5848 "descriptors.  See the description of the same flag in B<open>(2)  for "
5849 "reasons why this may be useful."
5850 msgstr ""
5851
5852 #. type: Plain text
5853 #: build/C/man2/pipe.2:102
5854 msgid "I<pipefd> is not valid."
5855 msgstr ""
5856
5857 #. type: Plain text
5858 #: build/C/man2/pipe.2:107
5859 msgid "(B<pipe2>())  Invalid value in I<flags>."
5860 msgstr ""
5861
5862 #. type: Plain text
5863 #: build/C/man2/pipe.2:110
5864 msgid "Too many file descriptors are in use by the process."
5865 msgstr ""
5866
5867 #. type: Plain text
5868 #: build/C/man2/pipe.2:118
5869 msgid ""
5870 "B<pipe2>()  was added to Linux in version 2.6.27; glibc support is available "
5871 "starting with version 2.9."
5872 msgstr ""
5873
5874 #. type: Plain text
5875 #: build/C/man2/pipe.2:121
5876 msgid "B<pipe>(): POSIX.1-2001."
5877 msgstr ""
5878
5879 #. type: Plain text
5880 #: build/C/man2/pipe.2:124
5881 msgid "B<pipe2>()  is Linux-specific."
5882 msgstr ""
5883
5884 #.  fork.2 refers to this example program.
5885 #. type: Plain text
5886 #: build/C/man2/pipe.2:140
5887 msgid ""
5888 "The following program creates a pipe, and then B<fork>(2)s to create a child "
5889 "process; the child inherits a duplicate set of file descriptors that refer "
5890 "to the same pipe.  After the B<fork>(2), each process closes the descriptors "
5891 "that it doesn't need for the pipe (see B<pipe>(7)).  The parent then writes "
5892 "the string contained in the program's command-line argument to the pipe, and "
5893 "the child reads this string a byte at a time from the pipe and echoes it on "
5894 "standard output."
5895 msgstr ""
5896
5897 #. type: Plain text
5898 #: build/C/man2/pipe.2:147
5899 #, no-wrap
5900 msgid ""
5901 "#include E<lt>sys/wait.hE<gt>\n"
5902 "#include E<lt>stdio.hE<gt>\n"
5903 "#include E<lt>stdlib.hE<gt>\n"
5904 "#include E<lt>unistd.hE<gt>\n"
5905 "#include E<lt>string.hE<gt>\n"
5906 msgstr ""
5907
5908 #. type: Plain text
5909 #: build/C/man2/pipe.2:154
5910 #, no-wrap
5911 msgid ""
5912 "int\n"
5913 "main(int argc, char *argv[])\n"
5914 "{\n"
5915 "    int pipefd[2];\n"
5916 "    pid_t cpid;\n"
5917 "    char buf;\n"
5918 msgstr ""
5919
5920 #. type: Plain text
5921 #: build/C/man2/pipe.2:159
5922 #, no-wrap
5923 msgid ""
5924 "    if (argc != 2) {\n"
5925 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
5926 "\texit(EXIT_FAILURE);\n"
5927 "    }\n"
5928 msgstr ""
5929
5930 #. type: Plain text
5931 #: build/C/man2/pipe.2:164
5932 #, no-wrap
5933 msgid ""
5934 "    if (pipe(pipefd) == -1) {\n"
5935 "        perror(\"pipe\");\n"
5936 "        exit(EXIT_FAILURE);\n"
5937 "    }\n"
5938 msgstr ""
5939
5940 #. type: Plain text
5941 #: build/C/man2/pipe.2:170
5942 #, no-wrap
5943 msgid ""
5944 "    cpid = fork();\n"
5945 "    if (cpid == -1) {\n"
5946 "        perror(\"fork\");\n"
5947 "        exit(EXIT_FAILURE);\n"
5948 "    }\n"
5949 msgstr ""
5950
5951 #. type: Plain text
5952 #: build/C/man2/pipe.2:173
5953 #, no-wrap
5954 msgid ""
5955 "    if (cpid == 0) {    /* Child reads from pipe */\n"
5956 "        close(pipefd[1]);          /* Close unused write end */\n"
5957 msgstr ""
5958
5959 #. type: Plain text
5960 #: build/C/man2/pipe.2:176
5961 #, no-wrap
5962 msgid ""
5963 "        while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
5964 "            write(STDOUT_FILENO, &buf, 1);\n"
5965 msgstr ""
5966
5967 #. type: Plain text
5968 #: build/C/man2/pipe.2:180
5969 #, no-wrap
5970 msgid ""
5971 "        write(STDOUT_FILENO, \"\\en\", 1);\n"
5972 "        close(pipefd[0]);\n"
5973 "        _exit(EXIT_SUCCESS);\n"
5974 msgstr ""
5975
5976 #. type: Plain text
5977 #: build/C/man2/pipe.2:189
5978 #, no-wrap
5979 msgid ""
5980 "    } else {            /* Parent writes argv[1] to pipe */\n"
5981 "        close(pipefd[0]);          /* Close unused read end */\n"
5982 "        write(pipefd[1], argv[1], strlen(argv[1]));\n"
5983 "        close(pipefd[1]);          /* Reader will see EOF */\n"
5984 "        wait(NULL);                /* Wait for child */\n"
5985 "        exit(EXIT_SUCCESS);\n"
5986 "    }\n"
5987 "}\n"
5988 msgstr ""
5989
5990 #. type: Plain text
5991 #: build/C/man2/pipe.2:197
5992 msgid ""
5993 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
5994 "B<pipe>(7)"
5995 msgstr ""
5996
5997 #. type: TH
5998 #: build/C/man3/popen.3:40
5999 #, no-wrap
6000 msgid "POPEN"
6001 msgstr ""
6002
6003 #. type: TH
6004 #: build/C/man3/popen.3:40
6005 #, no-wrap
6006 msgid "2010-02-03"
6007 msgstr ""
6008
6009 #. type: Plain text
6010 #: build/C/man3/popen.3:43
6011 msgid "popen, pclose - pipe stream to or from a process"
6012 msgstr ""
6013
6014 #. type: Plain text
6015 #: build/C/man3/popen.3:48
6016 #, no-wrap
6017 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
6018 msgstr ""
6019
6020 #. type: Plain text
6021 #: build/C/man3/popen.3:50
6022 #, no-wrap
6023 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
6024 msgstr ""
6025
6026 #. type: Plain text
6027 #: build/C/man3/popen.3:60
6028 msgid "B<popen>(), B<pclose>():"
6029 msgstr ""
6030
6031 #. type: Plain text
6032 #: build/C/man3/popen.3:62
6033 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
6034 msgstr ""
6035
6036 #. type: Plain text
6037 #: build/C/man3/popen.3:73
6038 msgid ""
6039 "The B<popen>()  function opens a process by creating a pipe, forking, and "
6040 "invoking the shell.  Since a pipe is by definition unidirectional, the "
6041 "I<type> argument may specify only reading or writing, not both; the "
6042 "resulting stream is correspondingly read-only or write-only."
6043 msgstr ""
6044
6045 #. type: Plain text
6046 #: build/C/man3/popen.3:97
6047 msgid ""
6048 "The I<command> argument is a pointer to a null-terminated string containing "
6049 "a shell command line.  This command is passed to I</bin/sh> using the B<-c> "
6050 "flag; interpretation, if any, is performed by the shell.  The I<type> "
6051 "argument is a pointer to a null-terminated string which must contain either "
6052 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing.  "
6053 "Since glibc 2.9, this argument can additionally include the letter "
6054 "\\(aqe\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>)  to be set "
6055 "on the underlying file descriptor; see the description of the B<O_CLOEXEC> "
6056 "flag in B<open>(2)  for reasons why this may be useful."
6057 msgstr ""
6058
6059 #. type: Plain text
6060 #: build/C/man3/popen.3:113
6061 msgid ""
6062 "The return value from B<popen>()  is a normal standard I/O stream in all "
6063 "respects save that it must be closed with B<pclose>()  rather than "
6064 "B<fclose>(3).  Writing to such a stream writes to the standard input of the "
6065 "command; the command's standard output is the same as that of the process "
6066 "that called B<popen>(), unless this is altered by the command itself.  "
6067 "Conversely, reading from a \"popened\" stream reads the command's standard "
6068 "output, and the command's standard input is the same as that of the process "
6069 "that called B<popen>()."
6070 msgstr ""
6071
6072 #. type: Plain text
6073 #: build/C/man3/popen.3:117
6074 msgid "Note that output B<popen>()  streams are fully buffered by default."
6075 msgstr ""
6076
6077 #. type: Plain text
6078 #: build/C/man3/popen.3:123
6079 msgid ""
6080 "The B<pclose>()  function waits for the associated process to terminate and "
6081 "returns the exit status of the command as returned by B<wait4>(2)."
6082 msgstr ""
6083
6084 #. type: Plain text
6085 #: build/C/man3/popen.3:131
6086 msgid ""
6087 "The B<popen>()  function returns NULL if the B<fork>(2)  or B<pipe>(2)  "
6088 "calls fail, or if it cannot allocate memory."
6089 msgstr ""
6090
6091 #.  These conditions actually give undefined results, so I commented
6092 #.  them out.
6093 #.  .I stream
6094 #.  is not associated with a "popen()ed" command, if
6095 #. .I stream
6096 #.  already "pclose()d", or if
6097 #. type: Plain text
6098 #: build/C/man3/popen.3:143
6099 msgid ""
6100 "The B<pclose>()  function returns -1 if B<wait4>(2)  returns an error, or "
6101 "some other error is detected."
6102 msgstr ""
6103
6104 #. type: Plain text
6105 #: build/C/man3/popen.3:162
6106 msgid ""
6107 "The B<popen>()  function does not set I<errno> if memory allocation fails.  "
6108 "If the underlying B<fork>(2)  or B<pipe>(2)  fails, I<errno> is set "
6109 "appropriately.  If the I<type> argument is invalid, and this condition is "
6110 "detected, I<errno> is set to B<EINVAL>."
6111 msgstr ""
6112
6113 #. type: Plain text
6114 #: build/C/man3/popen.3:169
6115 msgid ""
6116 "If B<pclose>()  cannot obtain the child status, I<errno> is set to "
6117 "B<ECHILD>."
6118 msgstr ""
6119
6120 #. type: Plain text
6121 #: build/C/man3/popen.3:175
6122 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
6123 msgstr ""
6124
6125 #. type: Plain text
6126 #: build/C/man3/popen.3:188
6127 msgid ""
6128 "Since the standard input of a command opened for reading shares its seek "
6129 "offset with the process that called B<popen>(), if the original process has "
6130 "done a buffered read, the command's input position may not be as expected.  "
6131 "Similarly, the output from a command opened for writing may become "
6132 "intermingled with that of the original process.  The latter can be avoided "
6133 "by calling B<fflush>(3)  before B<popen>()."
6134 msgstr ""
6135
6136 #.  .SH HISTORY
6137 #.  A
6138 #.  .BR popen ()
6139 #.  and a
6140 #.  .BR pclose ()
6141 #.  function appeared in Version 7 AT&T UNIX.
6142 #. type: Plain text
6143 #: build/C/man3/popen.3:198
6144 msgid ""
6145 "Failure to execute the shell is indistinguishable from the shell's failure "
6146 "to execute command, or an immediate exit of the command.  The only hint is "
6147 "an exit status of 127."
6148 msgstr ""
6149
6150 #. type: Plain text
6151 #: build/C/man3/popen.3:208
6152 msgid ""
6153 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
6154 "B<fopen>(3), B<stdio>(3), B<system>(3)"
6155 msgstr ""
6156
6157 #. type: TH
6158 #: build/C/man3/printf.3:34
6159 #, no-wrap
6160 msgid "PRINTF"
6161 msgstr ""
6162
6163 #. type: TH
6164 #: build/C/man3/printf.3:34
6165 #, no-wrap
6166 msgid "2013-03-05"
6167 msgstr ""
6168
6169 #. type: Plain text
6170 #: build/C/man3/printf.3:38
6171 msgid ""
6172 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
6173 "formatted output conversion"
6174 msgstr ""
6175
6176 #. type: Plain text
6177 #: build/C/man3/printf.3:42
6178 msgid "B<int printf(const char *>I<format>B<, ...);>"
6179 msgstr ""
6180
6181 #. type: Plain text
6182 #: build/C/man3/printf.3:44
6183 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
6184 msgstr ""
6185
6186 #. type: Plain text
6187 #: build/C/man3/printf.3:46
6188 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
6189 msgstr ""
6190
6191 #. type: Plain text
6192 #: build/C/man3/printf.3:48
6193 msgid ""
6194 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char *>I<format>B<, "
6195 "...);>"
6196 msgstr ""
6197
6198 #. type: Plain text
6199 #: build/C/man3/printf.3:50
6200 msgid "B<#include E<lt>stdarg.hE<gt>>"
6201 msgstr ""
6202
6203 #. type: Plain text
6204 #: build/C/man3/printf.3:52
6205 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
6206 msgstr ""
6207
6208 #. type: Plain text
6209 #: build/C/man3/printf.3:54
6210 msgid ""
6211 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
6212 ">I<ap>B<);>"
6213 msgstr ""
6214
6215 #. type: Plain text
6216 #: build/C/man3/printf.3:56
6217 msgid ""
6218 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list "
6219 ">I<ap>B<);>"
6220 msgstr ""
6221
6222 #. type: Plain text
6223 #: build/C/man3/printf.3:59
6224 msgid ""
6225 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
6226 "*>I<format>B<, va_list >I<ap>B<);>"
6227 msgstr ""
6228
6229 #. type: Plain text
6230 #: build/C/man3/printf.3:68
6231 msgid "B<snprintf>(), B<vsnprintf>():"
6232 msgstr ""
6233
6234 #. type: Plain text
6235 #: build/C/man3/printf.3:71
6236 msgid ""
6237 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
6238 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
6239 msgstr ""
6240
6241 #. type: Plain text
6242 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:85
6243 msgid "or I<cc -std=c99>"
6244 msgstr ""
6245
6246 #. type: Plain text
6247 #: build/C/man3/printf.3:101
6248 msgid ""
6249 "The functions in the B<printf>()  family produce output according to a "
6250 "I<format> as described below.  The functions B<printf>()  and B<vprintf>()  "
6251 "write output to I<stdout>, the standard output stream; B<fprintf>()  and "
6252 "B<vfprintf>()  write output to the given output I<stream>; B<sprintf>(), "
6253 "B<snprintf>(), B<vsprintf>()  and B<vsnprintf>()  write to the character "
6254 "string I<str>."
6255 msgstr ""
6256
6257 #. type: Plain text
6258 #: build/C/man3/printf.3:110
6259 msgid ""
6260 "The functions B<snprintf>()  and B<vsnprintf>()  write at most I<size> bytes "
6261 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
6262 msgstr ""
6263
6264 #. type: Plain text
6265 #: build/C/man3/printf.3:134
6266 msgid ""
6267 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>()  "
6268 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
6269 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
6270 "instead of a variable number of arguments.  These functions do not call the "
6271 "I<va_end> macro.  Because they invoke the I<va_arg> macro, the value of "
6272 "I<ap> is undefined after the call.  See B<stdarg>(3)."
6273 msgstr ""
6274
6275 #. type: Plain text
6276 #: build/C/man3/printf.3:141
6277 msgid ""
6278 "These eight functions write the output under the control of a I<format> "
6279 "string that specifies how subsequent arguments (or arguments accessed via "
6280 "the variable-length argument facilities of B<stdarg>(3))  are converted for "
6281 "output."
6282 msgstr ""
6283
6284 #. type: Plain text
6285 #: build/C/man3/printf.3:152
6286 msgid ""
6287 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
6288 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>()  would cause "
6289 "copying to take place between objects that overlap (e.g., if the target "
6290 "string array and one of the supplied input arguments refer to the same "
6291 "buffer).  See NOTES."
6292 msgstr ""
6293
6294 #. type: SS
6295 #: build/C/man3/printf.3:152
6296 #, no-wrap
6297 msgid "Return value"
6298 msgstr ""
6299
6300 #. type: Plain text
6301 #: build/C/man3/printf.3:155
6302 msgid ""
6303 "Upon successful return, these functions return the number of characters "
6304 "printed (excluding the null byte used to end output to strings)."
6305 msgstr ""
6306
6307 #. type: Plain text
6308 #: build/C/man3/printf.3:171
6309 msgid ""
6310 "The functions B<snprintf>()  and B<vsnprintf>()  do not write more than "
6311 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)).  If "
6312 "the output was truncated due to this limit then the return value is the "
6313 "number of characters (excluding the terminating null byte)  which would have "
6314 "been written to the final string if enough space had been available.  Thus, "
6315 "a return value of I<size> or more means that the output was truncated.  (See "
6316 "also below under NOTES.)"
6317 msgstr ""
6318
6319 #. type: Plain text
6320 #: build/C/man3/printf.3:173
6321 msgid "If an output error is encountered, a negative value is returned."
6322 msgstr ""
6323
6324 #. type: SS
6325 #: build/C/man3/printf.3:173
6326 #, no-wrap
6327 msgid "Format of the format string"
6328 msgstr ""
6329
6330 #. type: Plain text
6331 #: build/C/man3/printf.3:195
6332 msgid ""
6333 "The format string is a character string, beginning and ending in its initial "
6334 "shift state, if any.  The format string is composed of zero or more "
6335 "directives: ordinary characters (not B<%>), which are copied unchanged to "
6336 "the output stream; and conversion specifications, each of which results in "
6337 "fetching zero or more subsequent arguments.  Each conversion specification "
6338 "is introduced by the character B<%>, and ends with a I<conversion "
6339 "specifier>.  In between there may be (in this order) zero or more I<flags>, "
6340 "an optional minimum I<field width>, an optional I<precision> and an optional "
6341 "I<length modifier>."
6342 msgstr ""
6343
6344 #. type: Plain text
6345 #: build/C/man3/printf.3:208
6346 msgid ""
6347 "The arguments must correspond properly (after type promotion) with the "
6348 "conversion specifier.  By default, the arguments are used in the order "
6349 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
6350 "next argument (and it is an error if insufficiently many arguments are "
6351 "given).  One can also specify explicitly which argument is taken, at each "
6352 "place where an argument is required, by writing \"%m$\" instead of "
6353 "\\(aq%\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
6354 "denotes the position in the argument list of the desired argument, indexed "
6355 "starting from 1.  Thus,"
6356 msgstr ""
6357
6358 #. type: Plain text
6359 #: build/C/man3/printf.3:212
6360 #, no-wrap
6361 msgid "printf(\"%*d\", width, num);\n"
6362 msgstr ""
6363
6364 #. type: Plain text
6365 #: build/C/man3/printf.3:216
6366 msgid "and"
6367 msgstr ""
6368
6369 #. type: Plain text
6370 #: build/C/man3/printf.3:220
6371 #, no-wrap
6372 msgid "printf(\"%2$*1$d\", width, num);\n"
6373 msgstr ""
6374
6375 #. type: Plain text
6376 #: build/C/man3/printf.3:236
6377 msgid ""
6378 "are equivalent.  The second style allows repeated references to the same "
6379 "argument.  The C99 standard does not include the style using \\(aq$\\(aq, "
6380 "which comes from the Single UNIX Specification.  If the style using "
6381 "\\(aq$\\(aq is used, it must be used throughout for all conversions taking "
6382 "an argument and all width and precision arguments, but it may be mixed with "
6383 "\"%%\" formats which do not consume an argument.  There may be no gaps in "
6384 "the numbers of arguments specified using \\(aq$\\(aq; for example, if "
6385 "arguments 1 and 3 are specified, argument 2 must also be specified somewhere "
6386 "in the format string."
6387 msgstr ""
6388
6389 #. type: Plain text
6390 #: build/C/man3/printf.3:246
6391 msgid ""
6392 "For some numeric conversions a radix character (\"decimal point\") or "
6393 "thousands' grouping character is used.  The actual character used depends on "
6394 "the B<LC_NUMERIC> part of the locale.  The POSIX locale uses \\(aq.\\(aq as "
6395 "radix character, and does not have a grouping character.  Thus,"
6396 msgstr ""
6397
6398 #. type: Plain text
6399 #: build/C/man3/printf.3:250
6400 #, no-wrap
6401 msgid "    printf(\"%\\(aq.2f\", 1234567.89);\n"
6402 msgstr ""
6403
6404 #. type: Plain text
6405 #: build/C/man3/printf.3:255
6406 msgid ""
6407 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
6408 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
6409 msgstr ""
6410
6411 #. type: SS
6412 #: build/C/man3/printf.3:255
6413 #, no-wrap
6414 msgid "The flag characters"
6415 msgstr ""
6416
6417 #. type: Plain text
6418 #: build/C/man3/printf.3:257
6419 msgid "The character % is followed by zero or more of the following flags:"
6420 msgstr ""
6421
6422 #. type: TP
6423 #: build/C/man3/printf.3:257
6424 #, no-wrap
6425 msgid "B<#>"
6426 msgstr ""
6427
6428 #. type: Plain text
6429 #: build/C/man3/printf.3:291
6430 msgid ""
6431 "The value should be converted to an \"alternate form\".  For B<o> "
6432 "conversions, the first character of the output string is made zero (by "
6433 "prefixing a 0 if it was not zero already).  For B<x> and B<X> conversions, a "
6434 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
6435 "prepended to it.  For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
6436 "conversions, the result will always contain a decimal point, even if no "
6437 "digits follow it (normally, a decimal point appears in the results of those "
6438 "conversions only if a digit follows).  For B<g> and B<G> conversions, "
6439 "trailing zeros are not removed from the result as they would otherwise be.  "
6440 "For other conversions, the result is undefined."
6441 msgstr ""
6442
6443 #. type: TP
6444 #: build/C/man3/printf.3:291
6445 #, no-wrap
6446 msgid "B<\\&0>"
6447 msgstr ""
6448
6449 #. type: Plain text
6450 #: build/C/man3/printf.3:331
6451 msgid ""
6452 "The value should be zero padded.  For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
6453 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
6454 "converted value is padded on the left with zeros rather than blanks.  If the "
6455 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored.  If a "
6456 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
6457 "and B<X>), the B<\\&0> flag is ignored.  For other conversions, the behavior "
6458 "is undefined."
6459 msgstr ""
6460
6461 #. type: TP
6462 #: build/C/man3/printf.3:331
6463 #, no-wrap
6464 msgid "B<->"
6465 msgstr ""
6466
6467 #. type: Plain text
6468 #: build/C/man3/printf.3:344
6469 msgid ""
6470 "The converted value is to be left adjusted on the field boundary.  (The "
6471 "default is right justification.)  Except for B<n> conversions, the converted "
6472 "value is padded on the right with blanks, rather than on the left with "
6473 "blanks or zeros.  A B<-> overrides a B<\\&0> if both are given."
6474 msgstr ""
6475
6476 #. type: TP
6477 #: build/C/man3/printf.3:344
6478 #, no-wrap
6479 msgid "B<\\(aq \\(aq>"
6480 msgstr ""
6481
6482 #. type: Plain text
6483 #: build/C/man3/printf.3:348
6484 msgid ""
6485 "(a space) A blank should be left before a positive number (or empty string) "
6486 "produced by a signed conversion."
6487 msgstr ""
6488
6489 #. type: TP
6490 #: build/C/man3/printf.3:348
6491 #, no-wrap
6492 msgid "B<+>"
6493 msgstr ""
6494
6495 #. type: Plain text
6496 #: build/C/man3/printf.3:356
6497 msgid ""
6498 "A sign (+ or -) should always be placed before a number produced by a signed "
6499 "conversion.  By default a sign is used only for negative numbers.  A B<+> "
6500 "overrides a space if both are used."
6501 msgstr ""
6502
6503 #. type: Plain text
6504 #: build/C/man3/printf.3:359
6505 msgid ""
6506 "The five flag characters above are defined in the C standard.  The SUSv2 "
6507 "specifies one further flag character."
6508 msgstr ""
6509
6510 #. type: TP
6511 #: build/C/man3/printf.3:359
6512 #, no-wrap
6513 msgid "B<\\(aq>"
6514 msgstr ""
6515
6516 #. type: Plain text
6517 #: build/C/man3/printf.3:376
6518 msgid ""
6519 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>)  the "
6520 "output is to be grouped with thousands' grouping characters if the locale "
6521 "information indicates any.  Note that many versions of B<gcc>(1)  cannot "
6522 "parse this option and will issue a warning.  SUSv2 does not include "
6523 "I<%\\(aqF>."
6524 msgstr ""
6525
6526 #. type: Plain text
6527 #: build/C/man3/printf.3:378
6528 msgid "glibc 2.2 adds one further flag character."
6529 msgstr ""
6530
6531 #. type: TP
6532 #: build/C/man3/printf.3:378
6533 #, no-wrap
6534 msgid "B<I>"
6535 msgstr ""
6536
6537 #.  outdigits keyword in locale file
6538 #. type: Plain text
6539 #: build/C/man3/printf.3:388
6540 msgid ""
6541 "For decimal integer conversion (B<i>, B<d>, B<u>)  the output uses the "
6542 "locale's alternative output digits, if any.  For example, since glibc 2.2.3 "
6543 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
6544 msgstr ""
6545
6546 #. type: SS
6547 #: build/C/man3/printf.3:388
6548 #, no-wrap
6549 msgid "The field width"
6550 msgstr ""
6551
6552 #. type: Plain text
6553 #: build/C/man3/printf.3:404
6554 msgid ""
6555 "An optional decimal digit string (with nonzero first digit) specifying a "
6556 "minimum field width.  If the converted value has fewer characters than the "
6557 "field width, it will be padded with spaces on the left (or right, if the "
6558 "left-adjustment flag has been given).  Instead of a decimal digit string one "
6559 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
6560 "the field width is given in the next argument, or in the I<m>-th argument, "
6561 "respectively, which must be of type I<int>.  A negative field width is taken "
6562 "as a \\(aq-\\(aq flag followed by a positive field width.  In no case does a "
6563 "nonexistent or small field width cause truncation of a field; if the result "
6564 "of a conversion is wider than the field width, the field is expanded to "
6565 "contain the conversion result."
6566 msgstr ""
6567
6568 #. type: SS
6569 #: build/C/man3/printf.3:404
6570 #, no-wrap
6571 msgid "The precision"
6572 msgstr ""
6573
6574 #. type: Plain text
6575 #: build/C/man3/printf.3:440
6576 msgid ""
6577 "An optional precision, in the form of a period (\\(aq.\\(aq)  followed by an "
6578 "optional decimal digit string.  Instead of a decimal digit string one may "
6579 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
6580 "precision is given in the next argument, or in the m-th argument, "
6581 "respectively, which must be of type I<int>.  If the precision is given as "
6582 "just \\(aq.\\(aq, or the precision is negative, the precision is taken to be "
6583 "zero.  This gives the minimum number of digits to appear for B<d>, B<i>, "
6584 "B<o>, B<u>, B<x>, and B<X> conversions, the number of digits to appear after "
6585 "the radix character for B<a>, B<A>, B<e>, B<E>, B<f>, and B<F> conversions, "
6586 "the maximum number of significant digits for B<g> and B<G> conversions, or "
6587 "the maximum number of characters to be printed from a string for B<s> and "
6588 "B<S> conversions."
6589 msgstr ""
6590
6591 #. type: SS
6592 #: build/C/man3/printf.3:440
6593 #, no-wrap
6594 msgid "The length modifier"
6595 msgstr ""
6596
6597 #. type: Plain text
6598 #: build/C/man3/printf.3:450
6599 msgid ""
6600 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
6601 "B<X> conversion."
6602 msgstr ""
6603
6604 #. type: TP
6605 #: build/C/man3/printf.3:450 build/C/man3/scanf.3:294
6606 #, no-wrap
6607 msgid "B<hh>"
6608 msgstr ""
6609
6610 #. type: Plain text
6611 #: build/C/man3/printf.3:461
6612 msgid ""
6613 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
6614 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
6615 "I<signed char> argument."
6616 msgstr ""
6617
6618 #. type: TP
6619 #: build/C/man3/printf.3:461 build/C/man3/scanf.3:284
6620 #, no-wrap
6621 msgid "B<h>"
6622 msgstr ""
6623
6624 #. type: Plain text
6625 #: build/C/man3/printf.3:472
6626 msgid ""
6627 "A following integer conversion corresponds to a I<short int> or I<unsigned "
6628 "short int> argument, or a following B<n> conversion corresponds to a pointer "
6629 "to a I<short int> argument."
6630 msgstr ""
6631
6632 #. type: TP
6633 #: build/C/man3/printf.3:472 build/C/man3/scanf.3:311
6634 #, no-wrap
6635 msgid "B<l>"
6636 msgstr ""
6637
6638 #. type: Plain text
6639 #: build/C/man3/printf.3:491
6640 msgid ""
6641 "(ell) A following integer conversion corresponds to a I<long int> or "
6642 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
6643 "a pointer to a I<long int> argument, or a following B<c> conversion "
6644 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
6645 "corresponds to a pointer to I<wchar_t> argument."
6646 msgstr ""
6647
6648 #. type: TP
6649 #: build/C/man3/printf.3:491
6650 #, no-wrap
6651 msgid "B<ll>"
6652 msgstr ""
6653
6654 #. type: Plain text
6655 #: build/C/man3/printf.3:503
6656 msgid ""
6657 "(ell-ell).  A following integer conversion corresponds to a I<long long int> "
6658 "or I<unsigned long long int> argument, or a following B<n> conversion "
6659 "corresponds to a pointer to a I<long long int> argument."
6660 msgstr ""
6661
6662 #. type: TP
6663 #: build/C/man3/printf.3:503 build/C/man3/scanf.3:338
6664 #, no-wrap
6665 msgid "B<L>"
6666 msgstr ""
6667
6668 #. type: Plain text
6669 #: build/C/man3/printf.3:519
6670 msgid ""
6671 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
6672 "corresponds to a I<long double> argument.  (C99 allows %LF, but SUSv2 does "
6673 "not.)"
6674 msgstr ""
6675
6676 #. type: TP
6677 #: build/C/man3/printf.3:519 build/C/man3/scanf.3:354
6678 #, no-wrap
6679 msgid "B<q>"
6680 msgstr ""
6681
6682 #. type: Plain text
6683 #: build/C/man3/printf.3:525
6684 msgid ""
6685 "(\"quad\". 4.4BSD and Linux libc5 only.  Don't use.)  This is a synonym for "
6686 "B<ll>."
6687 msgstr ""
6688
6689 #. type: TP
6690 #: build/C/man3/printf.3:525 build/C/man3/scanf.3:302
6691 #, no-wrap
6692 msgid "B<j>"
6693 msgstr ""
6694
6695 #. type: Plain text
6696 #: build/C/man3/printf.3:532
6697 msgid ""
6698 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
6699 "argument."
6700 msgstr ""
6701
6702 #. type: TP
6703 #: build/C/man3/printf.3:532 build/C/man3/scanf.3:366
6704 #, no-wrap
6705 msgid "B<z>"
6706 msgstr ""
6707
6708 #. type: Plain text
6709 #: build/C/man3/printf.3:543
6710 msgid ""
6711 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
6712 "argument.  (Linux libc5 has B<Z> with this meaning.  Don't use it.)"
6713 msgstr ""
6714
6715 #. type: TP
6716 #: build/C/man3/printf.3:543 build/C/man3/scanf.3:359
6717 #, no-wrap
6718 msgid "B<t>"
6719 msgstr ""
6720
6721 #. type: Plain text
6722 #: build/C/man3/printf.3:548
6723 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
6724 msgstr ""
6725
6726 #. type: Plain text
6727 #: build/C/man3/printf.3:577
6728 msgid ""
6729 "The SUSv2 only knows about the length modifiers B<h> (in B<hd>, B<hi>, "
6730 "B<ho>, B<hx>, B<hX>, B<hn>)  and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
6731 "B<ln>, B<lc>, B<ls>)  and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
6732 msgstr ""
6733
6734 #. type: SS
6735 #: build/C/man3/printf.3:577
6736 #, no-wrap
6737 msgid "The conversion specifier"
6738 msgstr ""
6739
6740 #. type: Plain text
6741 #: build/C/man3/printf.3:580
6742 msgid ""
6743 "A character that specifies the type of conversion to be applied.  The "
6744 "conversion specifiers and their meanings are:"
6745 msgstr ""
6746
6747 #. type: TP
6748 #: build/C/man3/printf.3:580
6749 #, no-wrap
6750 msgid "B<d>, B<i>"
6751 msgstr ""
6752
6753 #. type: Plain text
6754 #: build/C/man3/printf.3:590
6755 msgid ""
6756 "The I<int> argument is converted to signed decimal notation.  The precision, "
6757 "if any, gives the minimum number of digits that must appear; if the "
6758 "converted value requires fewer digits, it is padded on the left with zeros.  "
6759 "The default precision is 1.  When 0 is printed with an explicit precision 0, "
6760 "the output is empty."
6761 msgstr ""
6762
6763 #. type: TP
6764 #: build/C/man3/printf.3:590
6765 #, no-wrap
6766 msgid "B<o>, B<u>, B<x>, B<X>"
6767 msgstr ""
6768
6769 #. type: Plain text
6770 #: build/C/man3/printf.3:617
6771 msgid ""
6772 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
6773 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>)  notation.  The "
6774 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
6775 "used for B<X> conversions.  The precision, if any, gives the minimum number "
6776 "of digits that must appear; if the converted value requires fewer digits, it "
6777 "is padded on the left with zeros.  The default precision is 1.  When 0 is "
6778 "printed with an explicit precision 0, the output is empty."
6779 msgstr ""
6780
6781 #. type: TP
6782 #: build/C/man3/printf.3:617
6783 #, no-wrap
6784 msgid "B<e>, B<E>"
6785 msgstr ""
6786
6787 #. type: Plain text
6788 #: build/C/man3/printf.3:636
6789 msgid ""
6790 "The I<double> argument is rounded and converted in the style "
6791 "[-]dB<\\&.>dddB<e>\\(+-dd where there is one digit before the decimal-point "
6792 "character and the number of digits after it is equal to the precision; if "
6793 "the precision is missing, it is taken as 6; if the precision is zero, no "
6794 "decimal-point character appears.  An B<E> conversion uses the letter B<E> "
6795 "(rather than B<e>)  to introduce the exponent.  The exponent always contains "
6796 "at least two digits; if the value is zero, the exponent is 00."
6797 msgstr ""
6798
6799 #. type: TP
6800 #: build/C/man3/printf.3:636
6801 #, no-wrap
6802 msgid "B<f>, B<F>"
6803 msgstr ""
6804
6805 #. type: Plain text
6806 #: build/C/man3/printf.3:647
6807 msgid ""
6808 "The I<double> argument is rounded and converted to decimal notation in the "
6809 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
6810 "character is equal to the precision specification.  If the precision is "
6811 "missing, it is taken as 6; if the precision is explicitly zero, no "
6812 "decimal-point character appears.  If a decimal point appears, at least one "
6813 "digit appears before it."
6814 msgstr ""
6815
6816 #. type: Plain text
6817 #: build/C/man3/printf.3:658
6818 msgid ""
6819 "(The SUSv2 does not know about B<F> and says that character string "
6820 "representations for infinity and NaN may be made available.  The C99 "
6821 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
6822 "starting with \"nan\" for NaN, in the case of B<f> conversion, and "
6823 "\"[-]INF\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
6824 msgstr ""
6825
6826 #. type: TP
6827 #: build/C/man3/printf.3:658
6828 #, no-wrap
6829 msgid "B<g>, B<G>"
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man3/printf.3:683
6834 msgid ""
6835 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
6836 "for B<G> conversions).  The precision specifies the number of significant "
6837 "digits.  If the precision is missing, 6 digits are given; if the precision "
6838 "is zero, it is treated as 1.  Style B<e> is used if the exponent from its "
6839 "conversion is less than -4 or greater than or equal to the precision.  "
6840 "Trailing zeros are removed from the fractional part of the result; a decimal "
6841 "point appears only if it is followed by at least one digit."
6842 msgstr ""
6843
6844 #. type: TP
6845 #: build/C/man3/printf.3:683
6846 #, no-wrap
6847 msgid "B<a>, B<A>"
6848 msgstr ""
6849
6850 #. type: Plain text
6851 #: build/C/man3/printf.3:707
6852 msgid ""
6853 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
6854 "to hexadecimal notation (using the letters abcdef)  in the style "
6855 "[-]B<0x>hB<\\&.>hhhhB<p>\\(+-; for B<A> conversion the prefix B<0X>, the "
6856 "letters ABCDEF, and the exponent separator B<P> is used.  There is one "
6857 "hexadecimal digit before the decimal point, and the number of digits after "
6858 "it is equal to the precision.  The default precision suffices for an exact "
6859 "representation of the value if an exact representation in base 2 exists and "
6860 "otherwise is sufficiently large to distinguish values of type I<double>.  "
6861 "The digit before the decimal point is unspecified for nonnormalized numbers, "
6862 "and nonzero but otherwise unspecified for normalized numbers."
6863 msgstr ""
6864
6865 #. type: TP
6866 #: build/C/man3/printf.3:707 build/C/man3/scanf.3:459 build/C/man3/wprintf.3:134
6867 #, no-wrap
6868 msgid "B<c>"
6869 msgstr ""
6870
6871 #. type: Plain text
6872 #: build/C/man3/printf.3:725
6873 msgid ""
6874 "If no B<l> modifier is present, the I<int> argument is converted to an "
6875 "I<unsigned char>, and the resulting character is written.  If an B<l> "
6876 "modifier is present, the I<wint_t> (wide character) argument is converted to "
6877 "a multibyte sequence by a call to the B<wcrtomb>(3)  function, with a "
6878 "conversion state starting in the initial state, and the resulting multibyte "
6879 "string is written."
6880 msgstr ""
6881
6882 #. type: TP
6883 #: build/C/man3/printf.3:725 build/C/man3/scanf.3:451 build/C/man3/wprintf.3:148
6884 #, no-wrap
6885 msgid "B<s>"
6886 msgstr ""
6887
6888 #. type: Plain text
6889 #: build/C/man3/printf.3:740
6890 msgid ""
6891 "If no B<l> modifier is present: The I<const char *> argument is expected to "
6892 "be a pointer to an array of character type (pointer to a string).  "
6893 "Characters from the array are written up to (but not including) a "
6894 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
6895 "than the number specified are written.  If a precision is given, no null "
6896 "byte need be present; if the precision is not specified, or is greater than "
6897 "the size of the array, the array must contain a terminating null byte."
6898 msgstr ""
6899
6900 #. type: Plain text
6901 #: build/C/man3/printf.3:767
6902 msgid ""
6903 "If an B<l> modifier is present: The I<const wchar_t *> argument is expected "
6904 "to be a pointer to an array of wide characters.  Wide characters from the "
6905 "array are converted to multibyte characters (each by a call to the "
6906 "B<wcrtomb>(3)  function, with a conversion state starting in the initial "
6907 "state before the first wide character), up to and including a terminating "
6908 "null wide character.  The resulting multibyte characters are written up to "
6909 "(but not including) the terminating null byte.  If a precision is specified, "
6910 "no more bytes than the number specified are written, but no partial "
6911 "multibyte characters are written.  Note that the precision determines the "
6912 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
6913 "positions>.  The array must contain a terminating null wide character, "
6914 "unless a precision is given and it is so small that the number of bytes "
6915 "written exceeds it before the end of the array is reached."
6916 msgstr ""
6917
6918 #. type: TP
6919 #: build/C/man3/printf.3:767
6920 #, no-wrap
6921 msgid "B<C>"
6922 msgstr ""
6923
6924 #. type: Plain text
6925 #: build/C/man3/printf.3:773
6926 msgid "(Not in C99, but in SUSv2.)  Synonym for B<lc>.  Don't use."
6927 msgstr ""
6928
6929 #. type: TP
6930 #: build/C/man3/printf.3:773
6931 #, no-wrap
6932 msgid "B<S>"
6933 msgstr ""
6934
6935 #. type: Plain text
6936 #: build/C/man3/printf.3:779
6937 msgid "(Not in C99, but in SUSv2.)  Synonym for B<ls>.  Don't use."
6938 msgstr ""
6939
6940 #. type: TP
6941 #: build/C/man3/printf.3:779 build/C/man3/scanf.3:503
6942 #, no-wrap
6943 msgid "B<p>"
6944 msgstr ""
6945
6946 #. type: Plain text
6947 #: build/C/man3/printf.3:787
6948 msgid ""
6949 "The I<void *> pointer argument is printed in hexadecimal (as if by B<%#x> or "
6950 "B<%#lx>)."
6951 msgstr ""
6952
6953 #. type: TP
6954 #: build/C/man3/printf.3:787 build/C/man3/scanf.3:511
6955 #, no-wrap
6956 msgid "B<n>"
6957 msgstr ""
6958
6959 #. type: Plain text
6960 #: build/C/man3/printf.3:794
6961 msgid ""
6962 "The number of characters written so far is stored into the integer indicated "
6963 "by the I<int *> (or variant) pointer argument.  No argument is converted."
6964 msgstr ""
6965
6966 #. type: TP
6967 #: build/C/man3/printf.3:794
6968 #, no-wrap
6969 msgid "B<m>"
6970 msgstr ""
6971
6972 #. type: Plain text
6973 #: build/C/man3/printf.3:800
6974 msgid ""
6975 "(Glibc extension.)  Print output of I<strerror(errno)>.  No argument is "
6976 "required."
6977 msgstr ""
6978
6979 #. type: TP
6980 #: build/C/man3/printf.3:800 build/C/man3/scanf.3:377
6981 #, no-wrap
6982 msgid "B<%>"
6983 msgstr ""
6984
6985 #. type: Plain text
6986 #: build/C/man3/printf.3:806
6987 msgid ""
6988 "A \\(aq%\\(aq is written.  No argument is converted.  The complete "
6989 "conversion specification is \\(aq%%\\(aq."
6990 msgstr ""
6991
6992 #. type: Plain text
6993 #: build/C/man3/printf.3:821
6994 msgid ""
6995 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
6996 "and B<vsprintf>()  functions conform to C89 and C99.  The B<snprintf>()  and "
6997 "B<vsnprintf>()  functions conform to C99."
6998 msgstr ""
6999
7000 #. type: Plain text
7001 #: build/C/man3/printf.3:834
7002 msgid ""
7003 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
7004 "other: when B<snprintf>()  is called with I<size>=0 then SUSv2 stipulates an "
7005 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
7006 "this case, and gives the return value (as always)  as the number of "
7007 "characters that would have been written in case the output string has been "
7008 "large enough."
7009 msgstr ""
7010
7011 #. type: Plain text
7012 #: build/C/man3/printf.3:848
7013 msgid ""
7014 "Linux libc4 knows about the five C standard flags.  It knows about the "
7015 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
7016 "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 "
7017 "B<X>, where B<F> is a synonym for B<f>.  Additionally, it accepts B<D>, "
7018 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>.  (This is bad, and "
7019 "caused serious bugs later, when support for B<%D> disappeared.)  No "
7020 "locale-dependent radix character, no thousands' separator, no NaN or "
7021 "infinity, no \"%m$\" and \"*m$\"."
7022 msgstr ""
7023
7024 #. type: Plain text
7025 #: build/C/man3/printf.3:859
7026 msgid ""
7027 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
7028 "locale, \"%m$\" and \"*m$\".  It knows about the length modifiers B<h>, "
7029 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
7030 "double> and for I<long long int> (this is a bug).  It no longer recognizes "
7031 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
7032 "outputs I<strerror(errno)>."
7033 msgstr ""
7034
7035 #. type: Plain text
7036 #: build/C/man3/printf.3:861
7037 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
7038 msgstr ""
7039
7040 #. type: Plain text
7041 #: build/C/man3/printf.3:864
7042 msgid ""
7043 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
7044 "characters B<a> and B<A>."
7045 msgstr ""
7046
7047 #. type: Plain text
7048 #: build/C/man3/printf.3:867
7049 msgid ""
7050 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
7051 "flag character B<I>."
7052 msgstr ""
7053
7054 #. type: Plain text
7055 #: build/C/man3/printf.3:869
7056 msgid "Some programs imprudently rely on code such as the following"
7057 msgstr ""
7058
7059 #. type: Plain text
7060 #: build/C/man3/printf.3:871
7061 #, no-wrap
7062 msgid "    sprintf(buf, \"%s some further text\", buf);\n"
7063 msgstr ""
7064
7065 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7075
7066 #. type: Plain text
7067 #: build/C/man3/printf.3:887
7068 msgid ""
7069 "to append text to I<buf>.  However, the standards explicitly note that the "
7070 "results are undefined if source and destination buffers overlap when calling "
7071 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>().  Depending "
7072 "on the version of B<gcc>(1)  used, and the compiler options employed, calls "
7073 "such as the above will B<not> produce the expected results."
7074 msgstr ""
7075
7076 #.  .SH HISTORY
7077 #.  UNIX V7 defines the three routines
7078 #.  .BR printf (),
7079 #.  .BR fprintf (),
7080 #.  .BR sprintf (),
7081 #.  and has the flag \-, the width or precision *, the length modifier l,
7082 #.  and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
7083 #.  This is still true for 2.9.1BSD, but 2.10BSD has the flags
7084 #.  #, + and <space> and no longer mentions D,O,U,X.
7085 #.  2.11BSD has
7086 #.  .BR vprintf (),
7087 #.  .BR vfprintf (),
7088 #.  .BR vsprintf (),
7089 #.  and warns not to use D,O,U,X.
7090 #.  4.3BSD Reno has the flag 0, the length modifiers h and L,
7091 #.  and the conversions n, p, E, G, X (with current meaning)
7092 #.  and deprecates D,O,U.
7093 #.  4.4BSD introduces the functions
7094 #.  .BR snprintf ()
7095 #.  and
7096 #.  .BR vsnprintf (),
7097 #.  and the length modifier q.
7098 #.  FreeBSD also has functions
7099 #.  .BR asprintf ()
7100 #.  and
7101 #.  .BR vasprintf (),
7102 #.  that allocate a buffer large enough for
7103 #.  .BR sprintf ().
7104 #.  In glibc there are functions
7105 #.  .BR dprintf ()
7106 #.  and
7107 #.  .BR vdprintf ()
7108 #.  that print to a file descriptor instead of a stream.
7109 #. type: Plain text
7110 #: build/C/man3/printf.3:929
7111 msgid ""
7112 "The glibc implementation of the functions B<snprintf>()  and B<vsnprintf>()  "
7113 "conforms to the C99 standard, that is, behaves as described above, since "
7114 "glibc version 2.1.  Until glibc 2.0.6 they would return -1 when the output "
7115 "was truncated."
7116 msgstr ""
7117
7118 #. type: Plain text
7119 #: build/C/man3/printf.3:946
7120 msgid ""
7121 "Because B<sprintf>()  and B<vsprintf>()  assume an arbitrarily long string, "
7122 "callers must be careful not to overflow the actual space; this is often "
7123 "impossible to assure.  Note that the length of the strings produced is "
7124 "locale-dependent and difficult to predict.  Use B<snprintf>()  and "
7125 "B<vsnprintf>()  instead (or B<asprintf>(3)  and B<vasprintf>(3))."
7126 msgstr ""
7127
7128 #. type: Plain text
7129 #: build/C/man3/printf.3:959
7130 msgid ""
7131 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
7132 "contains an B<snprintf>()  equivalent to B<sprintf>(), that is, one that "
7133 "ignores the I<size> argument.  Thus, the use of B<snprintf>()  with early "
7134 "libc4 leads to serious security problems."
7135 msgstr ""
7136
7137 #.  .PP
7138 #.  Some floating-point conversions under early libc4
7139 #.  caused memory leaks.
7140 #. type: Plain text
7141 #: build/C/man3/printf.3:973
7142 msgid ""
7143 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
7144 "contain a % character.  If I<foo> comes from untrusted user input, it may "
7145 "contain B<%n>, causing the B<printf>()  call to write to memory and creating "
7146 "a security hole."
7147 msgstr ""
7148
7149 #. type: Plain text
7150 #: build/C/man3/printf.3:977
7151 msgid "To print I<Pi> to five decimal places:"
7152 msgstr ""
7153
7154 #. type: Plain text
7155 #: build/C/man3/printf.3:983
7156 #, no-wrap
7157 msgid ""
7158 "#include E<lt>math.hE<gt>\n"
7159 "#include E<lt>stdio.hE<gt>\n"
7160 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
7161 msgstr ""
7162
7163 #. type: Plain text
7164 #: build/C/man3/printf.3:992
7165 msgid ""
7166 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
7167 "I<weekday> and I<month> are pointers to strings:"
7168 msgstr ""
7169
7170 #. type: Plain text
7171 #: build/C/man3/printf.3:998
7172 #, no-wrap
7173 msgid ""
7174 "#include E<lt>stdio.hE<gt>\n"
7175 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
7176 "        weekday, month, day, hour, min);\n"
7177 msgstr ""
7178
7179 #. type: Plain text
7180 #: build/C/man3/printf.3:1004
7181 msgid ""
7182 "Many countries use the day-month-year order.  Hence, an internationalized "
7183 "version must be able to print the arguments in an order specified by the "
7184 "format:"
7185 msgstr ""
7186
7187 #. type: Plain text
7188 #: build/C/man3/printf.3:1010
7189 #, no-wrap
7190 msgid ""
7191 "#include E<lt>stdio.hE<gt>\n"
7192 "fprintf(stdout, format,\n"
7193 "        weekday, month, day, hour, min);\n"
7194 msgstr ""
7195
7196 #. type: Plain text
7197 #: build/C/man3/printf.3:1017
7198 msgid ""
7199 "where I<format> depends on locale, and may permute the arguments.  With the "
7200 "value:"
7201 msgstr ""
7202
7203 #. type: Plain text
7204 #: build/C/man3/printf.3:1021
7205 #, no-wrap
7206 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
7207 msgstr ""
7208
7209 #. type: Plain text
7210 #: build/C/man3/printf.3:1025
7211 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
7212 msgstr ""
7213
7214 #. type: Plain text
7215 #: build/C/man3/printf.3:1028
7216 msgid ""
7217 "To allocate a sufficiently large string and print into it (code correct for "
7218 "both glibc 2.0 and glibc 2.1):"
7219 msgstr ""
7220
7221 #. type: Plain text
7222 #: build/C/man3/printf.3:1031
7223 msgid ""
7224 "If truncation occurs in glibc versions prior to 2.0.6, this is treated as an "
7225 "error instead of being handled gracefully."
7226 msgstr ""
7227
7228 #. type: Plain text
7229 #: build/C/man3/printf.3:1036
7230 #, no-wrap
7231 msgid ""
7232 "#include E<lt>stdio.hE<gt>\n"
7233 "#include E<lt>stdlib.hE<gt>\n"
7234 "#include E<lt>stdarg.hE<gt>\n"
7235 msgstr ""
7236
7237 #. type: Plain text
7238 #: build/C/man3/printf.3:1044
7239 #, no-wrap
7240 msgid ""
7241 "char *\n"
7242 "make_message(const char *fmt, ...)\n"
7243 "{\n"
7244 "    int n;\n"
7245 "    int size = 100;     /* Guess we need no more than 100 bytes */\n"
7246 "    char *p, *np;\n"
7247 "    va_list ap;\n"
7248 msgstr ""
7249
7250 #. type: Plain text
7251 #: build/C/man3/printf.3:1047
7252 #, no-wrap
7253 msgid ""
7254 "    if ((p = malloc(size)) == NULL)\n"
7255 "        return NULL;\n"
7256 msgstr ""
7257
7258 #. type: Plain text
7259 #: build/C/man3/printf.3:1049
7260 #, no-wrap
7261 msgid "    while (1) {\n"
7262 msgstr ""
7263
7264 #. type: Plain text
7265 #: build/C/man3/printf.3:1051
7266 #, no-wrap
7267 msgid "        /* Try to print in the allocated space */\n"
7268 msgstr ""
7269
7270 #. type: Plain text
7271 #: build/C/man3/printf.3:1055
7272 #, no-wrap
7273 msgid ""
7274 "        va_start(ap, fmt);\n"
7275 "        n = vsnprintf(p, size, fmt, ap);\n"
7276 "        va_end(ap);\n"
7277 msgstr ""
7278
7279 #. type: Plain text
7280 #: build/C/man3/printf.3:1057
7281 #, no-wrap
7282 msgid "        /* Check error code */\n"
7283 msgstr ""
7284
7285 #. type: Plain text
7286 #: build/C/man3/printf.3:1060
7287 #, no-wrap
7288 msgid ""
7289 "        if (n E<lt> 0)\n"
7290 "            return NULL;\n"
7291 msgstr ""
7292
7293 #. type: Plain text
7294 #: build/C/man3/printf.3:1062
7295 #, no-wrap
7296 msgid "        /* If that worked, return the string */\n"
7297 msgstr ""
7298
7299 #. type: Plain text
7300 #: build/C/man3/printf.3:1065
7301 #, no-wrap
7302 msgid ""
7303 "        if (n E<lt> size)\n"
7304 "            return p;\n"
7305 msgstr ""
7306
7307 #. type: Plain text
7308 #: build/C/man3/printf.3:1067
7309 #, no-wrap
7310 msgid "        /* Else try again with more space */\n"
7311 msgstr ""
7312
7313 #. type: Plain text
7314 #: build/C/man3/printf.3:1069
7315 #, no-wrap
7316 msgid "        size = n + 1;       /* Precisely what is needed */\n"
7317 msgstr ""
7318
7319 #. type: Plain text
7320 #: build/C/man3/printf.3:1079
7321 #, no-wrap
7322 msgid ""
7323 "        if ((np = realloc (p, size)) == NULL) {\n"
7324 "            free(p);\n"
7325 "            return NULL;\n"
7326 "        } else {\n"
7327 "            p = np;\n"
7328 "        }\n"
7329 "    }\n"
7330 "}\n"
7331 msgstr ""
7332
7333 #. type: Plain text
7334 #: build/C/man3/printf.3:1089
7335 msgid ""
7336 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
7337 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
7338 msgstr ""
7339
7340 #. type: TH
7341 #: build/C/man3/puts.3:26
7342 #, no-wrap
7343 msgid "PUTS"
7344 msgstr ""
7345
7346 #. type: TH
7347 #: build/C/man3/puts.3:26
7348 #, no-wrap
7349 msgid "2011-09-28"
7350 msgstr ""
7351
7352 #. type: Plain text
7353 #: build/C/man3/puts.3:29
7354 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
7355 msgstr ""
7356
7357 #. type: Plain text
7358 #: build/C/man3/puts.3:34
7359 #, no-wrap
7360 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7361 msgstr ""
7362
7363 #. type: Plain text
7364 #: build/C/man3/puts.3:36
7365 #, no-wrap
7366 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
7367 msgstr ""
7368
7369 #. type: Plain text
7370 #: build/C/man3/puts.3:38
7371 #, no-wrap
7372 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7373 msgstr ""
7374
7375 #. type: Plain text
7376 #: build/C/man3/puts.3:40
7377 #, no-wrap
7378 msgid "B<int putchar(int >I<c>B<);>\n"
7379 msgstr ""
7380
7381 #. type: Plain text
7382 #: build/C/man3/puts.3:42
7383 #, no-wrap
7384 msgid "B<int puts(const char *>I<s>B<);>\n"
7385 msgstr ""
7386
7387 #. type: Plain text
7388 #: build/C/man3/puts.3:51
7389 msgid ""
7390 "B<fputc>()  writes the character I<c>, cast to an I<unsigned char>, to "
7391 "I<stream>."
7392 msgstr ""
7393
7394 #. type: Plain text
7395 #: build/C/man3/puts.3:58
7396 msgid ""
7397 "B<fputs>()  writes the string I<s> to I<stream>, without its terminating "
7398 "null byte (\\(aq\\e0\\(aq)."
7399 msgstr ""
7400
7401 #. type: Plain text
7402 #: build/C/man3/puts.3:65
7403 msgid ""
7404 "B<putc>()  is equivalent to B<fputc>()  except that it may be implemented as "
7405 "a macro which evaluates I<stream> more than once."
7406 msgstr ""
7407
7408 #. type: Plain text
7409 #: build/C/man3/puts.3:69
7410 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<,>I<stdout>B<).>"
7411 msgstr ""
7412
7413 #. type: Plain text
7414 #: build/C/man3/puts.3:76
7415 msgid "B<puts>()  writes the string I<s> and a trailing newline to I<stdout>."
7416 msgstr ""
7417
7418 #. type: Plain text
7419 #: build/C/man3/puts.3:81
7420 msgid ""
7421 "Calls to the functions described here can be mixed with each other and with "
7422 "calls to other output functions from the I<stdio> library for the same "
7423 "output stream."
7424 msgstr ""
7425
7426 #. type: Plain text
7427 #: build/C/man3/puts.3:96
7428 msgid ""
7429 "B<fputc>(), B<putc>()  and B<putchar>()  return the character written as an "
7430 "I<unsigned char> cast to an I<int> or B<EOF> on error."
7431 msgstr ""
7432
7433 #. type: Plain text
7434 #: build/C/man3/puts.3:103
7435 msgid ""
7436 "B<puts>()  and B<fputs>()  return a nonnegative number on success, or B<EOF> "
7437 "on error."
7438 msgstr ""
7439
7440 #. type: Plain text
7441 #: build/C/man3/puts.3:112
7442 msgid ""
7443 "It is not advisable to mix calls to output functions from the I<stdio> "
7444 "library with low-level calls to B<write>(2)  for the file descriptor "
7445 "associated with the same output stream; the results will be undefined and "
7446 "very probably not what you want."
7447 msgstr ""
7448
7449 #. type: Plain text
7450 #: build/C/man3/puts.3:124
7451 msgid ""
7452 "B<write>(2), B<ferror>(3), B<fopen>(3), B<fputwc>(3), B<fputws>(3), "
7453 "B<fseek>(3), B<fwrite>(3), B<gets>(3), B<putwchar>(3), B<scanf>(3), "
7454 "B<unlocked_stdio>(3)"
7455 msgstr ""
7456
7457 #. type: TH
7458 #: build/C/man2/read.2:35
7459 #, no-wrap
7460 msgid "READ"
7461 msgstr ""
7462
7463 #. type: TH
7464 #: build/C/man2/read.2:35
7465 #, no-wrap
7466 msgid "2013-02-12"
7467 msgstr ""
7468
7469 #. type: Plain text
7470 #: build/C/man2/read.2:38
7471 msgid "read - read from a file descriptor"
7472 msgstr ""
7473
7474 #. type: Plain text
7475 #: build/C/man2/read.2:43
7476 #, no-wrap
7477 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
7478 msgstr ""
7479
7480 #. type: Plain text
7481 #: build/C/man2/read.2:52
7482 msgid ""
7483 "B<read>()  attempts to read up to I<count> bytes from file descriptor I<fd> "
7484 "into the buffer starting at I<buf>."
7485 msgstr ""
7486
7487 #. type: Plain text
7488 #: build/C/man2/read.2:60
7489 msgid ""
7490 "On files that support seeking, the read operation commences at the current "
7491 "file offset, and the file offset is incremented by the number of bytes "
7492 "read.  If the current file offset is at or past the end of file, no bytes "
7493 "are read, and B<read>()  returns zero."
7494 msgstr ""
7495
7496 #. type: Plain text
7497 #: build/C/man2/read.2:75
7498 msgid ""
7499 "If I<count> is zero, B<read>()  I<may> detect the errors described below.  "
7500 "In the absence of any errors, or if B<read>()  does not check for errors, a "
7501 "B<read>()  with a I<count> of 0 returns zero and has no other effects."
7502 msgstr ""
7503
7504 #. type: Plain text
7505 #: build/C/man2/read.2:81
7506 msgid "If I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
7507 msgstr ""
7508
7509 #. type: Plain text
7510 #: build/C/man2/read.2:95
7511 msgid ""
7512 "On success, the number of bytes read is returned (zero indicates end of "
7513 "file), and the file position is advanced by this number.  It is not an error "
7514 "if this number is smaller than the number of bytes requested; this may "
7515 "happen for example because fewer bytes are actually available right now "
7516 "(maybe because we were close to end-of-file, or because we are reading from "
7517 "a pipe, or from a terminal), or because B<read>()  was interrupted by a "
7518 "signal.  On error, -1 is returned, and I<errno> is set appropriately.  In "
7519 "this case it is left unspecified whether the file position (if any) changes."
7520 msgstr ""
7521
7522 #. type: TP
7523 #: build/C/man2/read.2:96 build/C/man3/scanf.3:549 build/C/man2/write.2:108
7524 #, no-wrap
7525 msgid "B<EAGAIN>"
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man2/read.2:103
7530 msgid ""
7531 "The file descriptor I<fd> refers to a file other than a socket and has been "
7532 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
7533 msgstr ""
7534
7535 #. type: TP
7536 #: build/C/man2/read.2:103 build/C/man2/write.2:115
7537 #, no-wrap
7538 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
7539 msgstr ""
7540
7541 #.  Actually EAGAIN on Linux
7542 #. type: Plain text
7543 #: build/C/man2/read.2:114
7544 msgid ""
7545 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
7546 "(B<O_NONBLOCK>), and the read would block.  POSIX.1-2001 allows either error "
7547 "to be returned for this case, and does not require these constants to have "
7548 "the same value, so a portable application should check for both "
7549 "possibilities."
7550 msgstr ""
7551
7552 #. type: Plain text
7553 #: build/C/man2/read.2:118
7554 msgid "I<fd> is not a valid file descriptor or is not open for reading."
7555 msgstr ""
7556
7557 #. type: Plain text
7558 #: build/C/man2/read.2:122 build/C/man2/write.2:145
7559 msgid "I<buf> is outside your accessible address space."
7560 msgstr ""
7561
7562 #. type: Plain text
7563 #: build/C/man2/read.2:126
7564 msgid ""
7565 "The call was interrupted by a signal before any data was read; see "
7566 "B<signal>(7)."
7567 msgstr ""
7568
7569 #. type: Plain text
7570 #: build/C/man2/read.2:137
7571 msgid ""
7572 "I<fd> is attached to an object which is unsuitable for reading; or the file "
7573 "was opened with the B<O_DIRECT> flag, and either the address specified in "
7574 "I<buf>, the value specified in I<count>, or the current file offset is not "
7575 "suitably aligned."
7576 msgstr ""
7577
7578 #. type: Plain text
7579 #: build/C/man2/read.2:147
7580 msgid ""
7581 "I<fd> was created via a call to B<timerfd_create>(2)  and the wrong size "
7582 "buffer was given to B<read>(); see B<timerfd_create>(2)  for further "
7583 "information."
7584 msgstr ""
7585
7586 #. type: Plain text
7587 #: build/C/man2/read.2:158
7588 msgid ""
7589 "I/O error.  This will happen for example when the process is in a background "
7590 "process group, tries to read from its controlling terminal, and either it is "
7591 "ignoring or blocking B<SIGTTIN> or its process group is orphaned.  It may "
7592 "also occur when there is a low-level I/O error while reading from a disk or "
7593 "tape."
7594 msgstr ""
7595
7596 #. type: Plain text
7597 #: build/C/man2/read.2:162
7598 msgid "I<fd> refers to a directory."
7599 msgstr ""
7600
7601 #. type: Plain text
7602 #: build/C/man2/read.2:173
7603 msgid ""
7604 "Other errors may occur, depending on the object connected to I<fd>.  POSIX "
7605 "allows a B<read>()  that is interrupted after reading some data to return -1 "
7606 "(with I<errno> set to B<EINTR>)  or to return the number of bytes already "
7607 "read."
7608 msgstr ""
7609
7610 #. type: Plain text
7611 #: build/C/man2/read.2:187
7612 msgid ""
7613 "On NFS file systems, reading small amounts of data will only update the "
7614 "timestamp the first time, subsequent calls may not do so.  This is caused by "
7615 "client side attribute caching, because most if not all NFS clients leave "
7616 "st_atime (last file access time)  updates to the server and client side "
7617 "reads satisfied from the client's cache will not cause st_atime updates on "
7618 "the server as there are no server side reads.  UNIX semantics can be "
7619 "obtained by disabling client side attribute caching, but in most situations "
7620 "this will substantially increase server load and decrease performance."
7621 msgstr ""
7622
7623 #. type: Plain text
7624 #: build/C/man2/read.2:200
7625 msgid ""
7626 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
7627 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
7628 "B<fread>(3)"
7629 msgstr ""
7630
7631 #. type: TH
7632 #: build/C/man2/readlink.2:43
7633 #, no-wrap
7634 msgid "READLINK"
7635 msgstr ""
7636
7637 #. type: TH
7638 #: build/C/man2/readlink.2:43
7639 #, no-wrap
7640 msgid "2011-09-20"
7641 msgstr ""
7642
7643 #. type: Plain text
7644 #: build/C/man2/readlink.2:46
7645 msgid "readlink - read value of a symbolic link"
7646 msgstr ""
7647
7648 #. type: Plain text
7649 #: build/C/man2/readlink.2:50
7650 msgid ""
7651 "B<ssize_t readlink(const char *>I<path>B<, char *>I<buf>B<, size_t "
7652 ">I<bufsiz>B<);>"
7653 msgstr ""
7654
7655 #. type: Plain text
7656 #: build/C/man2/readlink.2:58
7657 msgid "B<readlink>():"
7658 msgstr ""
7659
7660 #. type: Plain text
7661 #: build/C/man2/readlink.2:61 build/C/man2/symlink.2:50
7662 msgid ""
7663 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7664 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
7665 msgstr ""
7666
7667 #. type: Plain text
7668 #: build/C/man2/readlink.2:77
7669 msgid ""
7670 "B<readlink>()  places the contents of the symbolic link I<path> in the "
7671 "buffer I<buf>, which has size I<bufsiz>.  B<readlink>()  does not append a "
7672 "null byte to I<buf>.  It will truncate the contents (to a length of "
7673 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
7674 "contents."
7675 msgstr ""
7676
7677 #. type: Plain text
7678 #: build/C/man2/readlink.2:85
7679 msgid ""
7680 "On success, B<readlink>()  returns the number of bytes placed in I<buf>.  On "
7681 "error, -1 is returned and I<errno> is set to indicate the error."
7682 msgstr ""
7683
7684 #. type: Plain text
7685 #: build/C/man2/readlink.2:91
7686 msgid ""
7687 "Search permission is denied for a component of the path prefix.  (See also "
7688 "B<path_resolution>(7).)"
7689 msgstr ""
7690
7691 #. type: Plain text
7692 #: build/C/man2/readlink.2:95
7693 msgid "I<buf> extends outside the process's allocated address space."
7694 msgstr ""
7695
7696 #.  At the glibc level, bufsiz is unsigned, so this error can only occur
7697 #.  if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
7698 #.  and this error can also occur if bufsiz < 0.
7699 #.  See: http://thread.gmane.org/gmane.linux.man/380
7700 #.  Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
7701 #. type: Plain text
7702 #: build/C/man2/readlink.2:104
7703 msgid "I<bufsiz> is not positive."
7704 msgstr ""
7705
7706 #. type: Plain text
7707 #: build/C/man2/readlink.2:107
7708 msgid "The named file is not a symbolic link."
7709 msgstr ""
7710
7711 #. type: Plain text
7712 #: build/C/man2/readlink.2:110
7713 msgid "An I/O error occurred while reading from the file system."
7714 msgstr ""
7715
7716 #. type: Plain text
7717 #: build/C/man2/readlink.2:113
7718 msgid "Too many symbolic links were encountered in translating the pathname."
7719 msgstr ""
7720
7721 #. type: Plain text
7722 #: build/C/man2/readlink.2:116
7723 msgid "A pathname, or a component of a pathname, was too long."
7724 msgstr ""
7725
7726 #. type: Plain text
7727 #: build/C/man2/readlink.2:119
7728 msgid "The named file does not exist."
7729 msgstr ""
7730
7731 #. type: Plain text
7732 #: build/C/man2/readlink.2:125
7733 msgid "A component of the path prefix is not a directory."
7734 msgstr ""
7735
7736 #. type: Plain text
7737 #: build/C/man2/readlink.2:130
7738 msgid "4.4BSD (B<readlink>()  first appeared in 4.2BSD), POSIX.1-2001."
7739 msgstr ""
7740
7741 #. type: Plain text
7742 #: build/C/man2/readlink.2:138
7743 msgid ""
7744 "In versions of glibc up to and including glibc 2.4, the return type of "
7745 "B<readlink>()  was declared as I<int>.  Nowadays, the return type is "
7746 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
7747 msgstr ""
7748
7749 #. type: Plain text
7750 #: build/C/man2/readlink.2:157
7751 msgid ""
7752 "Using a statically sized buffer might not provide enough room for the "
7753 "symbolic link contents.  The required size for the buffer can be obtained "
7754 "from the I<stat.st_size> value returned by a call to B<lstat>(2)  on the "
7755 "link.  However, the number of bytes written by B<readlink>()  should be "
7756 "checked to make sure that the size of the symbolic link did not increase "
7757 "between the calls.  Dynamically allocating the buffer for B<readlink>()  "
7758 "also addresses a common portability problem when using I<PATH_MAX> for the "
7759 "buffer size, as this constant is not guaranteed to be defined per POSIX if "
7760 "the system does not have such limit."
7761 msgstr ""
7762
7763 #. type: Plain text
7764 #: build/C/man2/readlink.2:163
7765 msgid ""
7766 "The following program allocates the buffer needed by B<readlink>()  "
7767 "dynamically from the information provided by B<lstat>(), making sure there's "
7768 "no race condition between the calls."
7769 msgstr ""
7770
7771 #. type: Plain text
7772 #: build/C/man2/readlink.2:170
7773 #, no-wrap
7774 msgid ""
7775 "#include E<lt>sys/types.hE<gt>\n"
7776 "#include E<lt>sys/stat.hE<gt>\n"
7777 "#include E<lt>stdio.hE<gt>\n"
7778 "#include E<lt>stdlib.hE<gt>\n"
7779 "#include E<lt>unistd.hE<gt>\n"
7780 msgstr ""
7781
7782 #. type: Plain text
7783 #: build/C/man2/readlink.2:177
7784 #, no-wrap
7785 msgid ""
7786 "int\n"
7787 "main(int argc, char *argv[])\n"
7788 "{\n"
7789 "    struct stat sb;\n"
7790 "    char *linkname;\n"
7791 "    ssize_t r;\n"
7792 msgstr ""
7793
7794 #. type: Plain text
7795 #: build/C/man2/readlink.2:182
7796 #, no-wrap
7797 msgid ""
7798 "    if (argc != 2) {\n"
7799 "        fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
7800 "        exit(EXIT_FAILURE);\n"
7801 "    }\n"
7802 msgstr ""
7803
7804 #. type: Plain text
7805 #: build/C/man2/readlink.2:187
7806 #, no-wrap
7807 msgid ""
7808 "    if (lstat(argv[1], &sb) == -1) {\n"
7809 "        perror(\"lstat\");\n"
7810 "        exit(EXIT_FAILURE);\n"
7811 "    }\n"
7812 msgstr ""
7813
7814 #. type: Plain text
7815 #: build/C/man2/readlink.2:193
7816 #, no-wrap
7817 msgid ""
7818 "    linkname = malloc(sb.st_size + 1);\n"
7819 "    if (linkname == NULL) {\n"
7820 "        fprintf(stderr, \"insufficient memory\\en\");\n"
7821 "        exit(EXIT_FAILURE);\n"
7822 "    }\n"
7823 msgstr ""
7824
7825 #. type: Plain text
7826 #: build/C/man2/readlink.2:195
7827 #, no-wrap
7828 msgid "    r = readlink(argv[1], linkname, sb.st_size + 1);\n"
7829 msgstr ""
7830
7831 #. type: Plain text
7832 #: build/C/man2/readlink.2:200
7833 #, no-wrap
7834 msgid ""
7835 "    if (r E<lt> 0) {\n"
7836 "        perror(\"lstat\");\n"
7837 "        exit(EXIT_FAILURE);\n"
7838 "    }\n"
7839 msgstr ""
7840
7841 #. type: Plain text
7842 #: build/C/man2/readlink.2:206
7843 #, no-wrap
7844 msgid ""
7845 "    if (r E<gt> sb.st_size) {\n"
7846 "        fprintf(stderr, \"symlink increased in size \"\n"
7847 "                        \"between lstat() and readlink()\\en\");\n"
7848 "        exit(EXIT_FAILURE);\n"
7849 "    }\n"
7850 msgstr ""
7851
7852 #. type: Plain text
7853 #: build/C/man2/readlink.2:208
7854 #, no-wrap
7855 msgid "    linkname[sb.st_size] = \\(aq\\e0\\(aq;\n"
7856 msgstr ""
7857
7858 #. type: Plain text
7859 #: build/C/man2/readlink.2:210
7860 #, no-wrap
7861 msgid ""
7862 "    printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], "
7863 "linkname);\n"
7864 msgstr ""
7865
7866 #. type: Plain text
7867 #: build/C/man2/readlink.2:222
7868 msgid ""
7869 "B<readlink>(1), B<lstat>(2), B<readlinkat>(2), B<stat>(2), B<symlink>(2), "
7870 "B<path_resolution>(7), B<symlink>(7)"
7871 msgstr ""
7872
7873 #. type: TH
7874 #: build/C/man2/readv.2:32
7875 #, no-wrap
7876 msgid "READV"
7877 msgstr ""
7878
7879 #. type: TH
7880 #: build/C/man2/readv.2:32
7881 #, no-wrap
7882 msgid "2010-11-17"
7883 msgstr ""
7884
7885 #. type: Plain text
7886 #: build/C/man2/readv.2:35
7887 msgid "readv, writev, preadv, pwritev - read or write data into multiple buffers"
7888 msgstr ""
7889
7890 #. type: Plain text
7891 #: build/C/man2/readv.2:38
7892 #, no-wrap
7893 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
7894 msgstr ""
7895
7896 #. type: Plain text
7897 #: build/C/man2/readv.2:40
7898 #, no-wrap
7899 msgid ""
7900 "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7901 ">I<iovcnt>B<);>\n"
7902 msgstr ""
7903
7904 #. type: Plain text
7905 #: build/C/man2/readv.2:42
7906 #, no-wrap
7907 msgid ""
7908 "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7909 ">I<iovcnt>B<);>\n"
7910 msgstr ""
7911
7912 #. type: Plain text
7913 #: build/C/man2/readv.2:45
7914 #, no-wrap
7915 msgid ""
7916 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7917 ">I<iovcnt>B<,>\n"
7918 "B<               off_t >I<offset>B<);>\n"
7919 msgstr ""
7920
7921 #. type: Plain text
7922 #: build/C/man2/readv.2:48
7923 #, no-wrap
7924 msgid ""
7925 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7926 ">I<iovcnt>B<,>\n"
7927 "B<                off_t >I<offset>B<);>\n"
7928 msgstr ""
7929
7930 #. type: Plain text
7931 #: build/C/man2/readv.2:58
7932 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
7933 msgstr ""
7934
7935 #. type: Plain text
7936 #: build/C/man2/readv.2:68
7937 msgid ""
7938 "The B<readv>()  system call reads I<iovcnt> buffers from the file associated "
7939 "with the file descriptor I<fd> into the buffers described by I<iov> "
7940 "(\"scatter input\")."
7941 msgstr ""
7942
7943 #. type: Plain text
7944 #: build/C/man2/readv.2:78
7945 msgid ""
7946 "The B<writev>()  system call writes I<iovcnt> buffers of data described by "
7947 "I<iov> to the file associated with the file descriptor I<fd> (\"gather "
7948 "output\")."
7949 msgstr ""
7950
7951 #. type: Plain text
7952 #: build/C/man2/readv.2:87
7953 msgid ""
7954 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
7955 "I<E<lt>sys/uio.hE<gt>> as:"
7956 msgstr ""
7957
7958 #. type: Plain text
7959 #: build/C/man2/readv.2:95
7960 #, no-wrap
7961 msgid ""
7962 "struct iovec {\n"
7963 "    void  *iov_base;    /* Starting address */\n"
7964 "    size_t iov_len;     /* Number of bytes to transfer */\n"
7965 "};\n"
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man2/readv.2:103
7970 msgid ""
7971 "The B<readv>()  system call works just like B<read>(2)  except that multiple "
7972 "buffers are filled."
7973 msgstr ""
7974
7975 #. type: Plain text
7976 #: build/C/man2/readv.2:109
7977 msgid ""
7978 "The B<writev>()  system call works just like B<write>(2)  except that "
7979 "multiple buffers are written out."
7980 msgstr ""
7981
7982 #. type: Plain text
7983 #: build/C/man2/readv.2:128
7984 msgid ""
7985 "Buffers are processed in array order.  This means that B<readv>()  "
7986 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on.  (If "
7987 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
7988 "filled.)  Similarly, B<writev>()  writes out the entire contents of "
7989 "I<iov>[0] before proceeding to I<iov>[1], and so on."
7990 msgstr ""
7991
7992 #. type: Plain text
7993 #: build/C/man2/readv.2:146
7994 msgid ""
7995 "The data transfers performed by B<readv>()  and B<writev>()  are atomic: the "
7996 "data written by B<writev>()  is written as a single block that is not "
7997 "intermingled with output from writes in other processes (but see B<pipe>(7)  "
7998 "for an exception); analogously, B<readv>()  is guaranteed to read a "
7999 "contiguous block of data from the file, regardless of read operations "
8000 "performed in other threads or processes that have file descriptors referring "
8001 "to the same open file description (see B<open>(2))."
8002 msgstr ""
8003
8004 #. type: SS
8005 #: build/C/man2/readv.2:146
8006 #, no-wrap
8007 msgid "preadv() and pwritev()"
8008 msgstr ""
8009
8010 #. type: Plain text
8011 #: build/C/man2/readv.2:159
8012 msgid ""
8013 "The B<preadv>()  system call combines the functionality of B<readv>()  and "
8014 "B<pread>(2).  It performs the same task as B<readv>(), but adds a fourth "
8015 "argument, I<offset>, which specifies the file offset at which the input "
8016 "operation is to be performed."
8017 msgstr ""
8018
8019 #. type: Plain text
8020 #: build/C/man2/readv.2:172
8021 msgid ""
8022 "The B<pwritev>()  system call combines the functionality of B<writev>()  and "
8023 "B<pwrite>(2).  It performs the same task as B<writev>(), but adds a fourth "
8024 "argument, I<offset>, which specifies the file offset at which the output "
8025 "operation is to be performed."
8026 msgstr ""
8027
8028 #. type: Plain text
8029 #: build/C/man2/readv.2:177
8030 msgid ""
8031 "The file offset is not changed by these system calls.  The file referred to "
8032 "by I<fd> must be capable of seeking."
8033 msgstr ""
8034
8035 #. type: Plain text
8036 #: build/C/man2/readv.2:188
8037 msgid ""
8038 "On success, B<readv>()  and B<preadv>()  return the number of bytes read; "
8039 "B<writev>()  and B<pwritev>()  return the number of bytes written.  On "
8040 "error, -1 is returned, and I<errno> is set appropriately."
8041 msgstr ""
8042
8043 #. type: Plain text
8044 #: build/C/man2/readv.2:200
8045 msgid ""
8046 "The errors are as given for B<read>(2)  and B<write>(2).  Furthermore, "
8047 "B<preadv>()  and B<pwritev>()  can also fail for the same reasons as "
8048 "B<lseek>(2).  Additionally, the following error is defined:"
8049 msgstr ""
8050
8051 #. type: Plain text
8052 #: build/C/man2/readv.2:209
8053 msgid ""
8054 "The sum of the I<iov_len> values overflows an I<ssize_t> value.  Or, the "
8055 "vector count I<iovcnt> is less than zero or greater than the permitted "
8056 "maximum."
8057 msgstr ""
8058
8059 #. type: Plain text
8060 #: build/C/man2/readv.2:214
8061 msgid ""
8062 "B<preadv>()  and B<pwritev>()  first appeared in Linux 2.6.30; library "
8063 "support was added in glibc 2.10."
8064 msgstr ""
8065
8066 #.  The readv/writev system calls were buggy before Linux 1.3.40.
8067 #.  (Says release.libc.)
8068 #. type: Plain text
8069 #: build/C/man2/readv.2:222
8070 msgid ""
8071 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
8072 "4.2BSD), POSIX.1-2001.  Linux libc5 used I<size_t> as the type of the "
8073 "I<iovcnt> argument, and I<int> as the return type."
8074 msgstr ""
8075
8076 #. type: Plain text
8077 #: build/C/man2/readv.2:226
8078 msgid "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
8079 msgstr ""
8080
8081 #. type: SS
8082 #: build/C/man2/readv.2:227
8083 #, no-wrap
8084 msgid "Linux notes"
8085 msgstr ""
8086
8087 #. type: Plain text
8088 #: build/C/man2/readv.2:258
8089 msgid ""
8090 "POSIX.1-2001 allows an implementation to place a limit on the number of "
8091 "items that can be passed in I<iov>.  An implementation can advertise its "
8092 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
8093 "return value from I<sysconf(_SC_IOV_MAX)>.  On Linux, the limit advertised "
8094 "by these mechanisms is 1024, which is the true kernel limit.  However, the "
8095 "glibc wrapper functions do some extra work if they detect that the "
8096 "underlying kernel system call failed because this limit was exceeded.  In "
8097 "the case of B<readv>()  the wrapper function allocates a temporary buffer "
8098 "large enough for all of the items specified by I<iov>, passes that buffer in "
8099 "a call to B<read>(2), copies data from the buffer to the locations specified "
8100 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
8101 "buffer.  The wrapper function for B<writev>()  performs the analogous task "
8102 "using a temporary buffer and a call to B<write>(2)."
8103 msgstr ""
8104
8105 #. type: Plain text
8106 #: build/C/man2/readv.2:265
8107 msgid ""
8108 "It is not advisable to mix calls to B<readv>()  or B<writev>(), which "
8109 "operate on file descriptors, with the functions from the stdio library; the "
8110 "results will be undefined and probably not what you want."
8111 msgstr ""
8112
8113 #. type: Plain text
8114 #: build/C/man2/readv.2:268
8115 msgid "The following code sample demonstrates the use of B<writev>():"
8116 msgstr ""
8117
8118 #. type: Plain text
8119 #: build/C/man2/readv.2:275
8120 #, no-wrap
8121 msgid ""
8122 "char *str0 = \"hello \";\n"
8123 "char *str1 = \"world\\en\";\n"
8124 "struct iovec iov[2];\n"
8125 "ssize_t nwritten;\n"
8126 msgstr ""
8127
8128 #. type: Plain text
8129 #: build/C/man2/readv.2:280
8130 #, no-wrap
8131 msgid ""
8132 "iov[0].iov_base = str0;\n"
8133 "iov[0].iov_len = strlen(str0);\n"
8134 "iov[1].iov_base = str1;\n"
8135 "iov[1].iov_len = strlen(str1);\n"
8136 msgstr ""
8137
8138 #. type: Plain text
8139 #: build/C/man2/readv.2:282
8140 #, no-wrap
8141 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
8142 msgstr ""
8143
8144 #. type: Plain text
8145 #: build/C/man2/readv.2:288
8146 msgid "B<pread>(2), B<read>(2), B<write>(2)"
8147 msgstr ""
8148
8149 #. type: TH
8150 #: build/C/man3/remove.3:31
8151 #, no-wrap
8152 msgid "REMOVE"
8153 msgstr ""
8154
8155 #. type: TH
8156 #: build/C/man3/remove.3:31
8157 #, no-wrap
8158 msgid "2008-12-03"
8159 msgstr ""
8160
8161 #. type: Plain text
8162 #: build/C/man3/remove.3:34
8163 msgid "remove - remove a file or directory"
8164 msgstr ""
8165
8166 #. type: Plain text
8167 #: build/C/man3/remove.3:38
8168 msgid "B<int remove(const char *>I<pathname>B<);>"
8169 msgstr ""
8170
8171 #. type: Plain text
8172 #: build/C/man3/remove.3:46
8173 msgid ""
8174 "B<remove>()  deletes a name from the file system.  It calls B<unlink>(2)  "
8175 "for files, and B<rmdir>(2)  for directories."
8176 msgstr ""
8177
8178 #. type: Plain text
8179 #: build/C/man3/remove.3:50
8180 msgid ""
8181 "If the removed name was the last link to a file and no processes have the "
8182 "file open, the file is deleted and the space it was using is made available "
8183 "for reuse."
8184 msgstr ""
8185
8186 #. type: Plain text
8187 #: build/C/man3/remove.3:55
8188 msgid ""
8189 "If the name was the last link to a file, but any processes still have the "
8190 "file open, the file will remain in existence until the last file descriptor "
8191 "referring to it is closed."
8192 msgstr ""
8193
8194 #. type: Plain text
8195 #: build/C/man3/remove.3:57
8196 msgid "If the name referred to a symbolic link, the link is removed."
8197 msgstr ""
8198
8199 #. type: Plain text
8200 #: build/C/man3/remove.3:60
8201 msgid ""
8202 "If the name referred to a socket, FIFO, or device, the name is removed, but "
8203 "processes which have the object open may continue to use it."
8204 msgstr ""
8205
8206 #. type: Plain text
8207 #: build/C/man3/remove.3:70
8208 msgid "The errors that occur are those for B<unlink>(2)  and B<rmdir>(2)."
8209 msgstr ""
8210
8211 #. type: Plain text
8212 #: build/C/man3/remove.3:72
8213 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
8214 msgstr ""
8215
8216 #. type: Plain text
8217 #: build/C/man3/remove.3:78
8218 msgid ""
8219 "Under libc4 and libc5, B<remove>()  was an alias for B<unlink>(2)  (and "
8220 "hence would not remove directories)."
8221 msgstr ""
8222
8223 #. type: Plain text
8224 #: build/C/man3/remove.3:81 build/C/man2/unlink.2:148
8225 msgid ""
8226 "Infelicities in the protocol underlying NFS can cause the unexpected "
8227 "disappearance of files which are still being used."
8228 msgstr ""
8229
8230 #. type: Plain text
8231 #: build/C/man3/remove.3:92
8232 msgid ""
8233 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
8234 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
8235 msgstr ""
8236
8237 #. type: TH
8238 #: build/C/man2/rename.2:32
8239 #, no-wrap
8240 msgid "RENAME"
8241 msgstr ""
8242
8243 #. type: Plain text
8244 #: build/C/man2/rename.2:35
8245 msgid "rename - change the name or location of a file"
8246 msgstr ""
8247
8248 #. type: Plain text
8249 #: build/C/man2/rename.2:39
8250 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
8251 msgstr ""
8252
8253 #. type: Plain text
8254 #: build/C/man2/rename.2:48
8255 msgid ""
8256 "B<rename>()  renames a file, moving it between directories if required.  Any "
8257 "other hard links to the file (as created using B<link>(2))  are unaffected.  "
8258 "Open file descriptors for I<oldpath> are also unaffected."
8259 msgstr ""
8260
8261 #. type: Plain text
8262 #: build/C/man2/rename.2:56
8263 msgid ""
8264 "If I<newpath> already exists it will be atomically replaced (subject to a "
8265 "few conditions; see ERRORS below), so that there is no point at which "
8266 "another process attempting to access I<newpath> will find it missing."
8267 msgstr ""
8268
8269 #. type: Plain text
8270 #: build/C/man2/rename.2:64
8271 msgid ""
8272 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
8273 "file, then B<rename>()  does nothing, and returns a success status."
8274 msgstr ""
8275
8276 #. type: Plain text
8277 #: build/C/man2/rename.2:72
8278 msgid ""
8279 "If I<newpath> exists but the operation fails for some reason B<rename>()  "
8280 "guarantees to leave an instance of I<newpath> in place."
8281 msgstr ""
8282
8283 #. type: Plain text
8284 #: build/C/man2/rename.2:78
8285 msgid ""
8286 "I<oldpath> can specify a directory.  In this case, I<newpath> must either "
8287 "not exist, or it must specify an empty directory."
8288 msgstr ""
8289
8290 #. type: Plain text
8291 #: build/C/man2/rename.2:85
8292 msgid ""
8293 "However, when overwriting there will probably be a window in which both "
8294 "I<oldpath> and I<newpath> refer to the file being renamed."
8295 msgstr ""
8296
8297 #. type: Plain text
8298 #: build/C/man2/rename.2:91
8299 msgid ""
8300 "If I<oldpath> refers to a symbolic link the link is renamed; if I<newpath> "
8301 "refers to a symbolic link the link will be overwritten."
8302 msgstr ""
8303
8304 #. type: Plain text
8305 #: build/C/man2/rename.2:116
8306 msgid ""
8307 "Write permission is denied for the directory containing I<oldpath> or "
8308 "I<newpath>, or, search permission is denied for one of the directories in "
8309 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
8310 "and does not allow write permission (needed to update the I<..> entry).  "
8311 "(See also B<path_resolution>(7).)"
8312 msgstr ""
8313
8314 #. type: TP
8315 #: build/C/man2/rename.2:116 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:71
8316 #, no-wrap
8317 msgid "B<EBUSY>"
8318 msgstr ""
8319
8320 #. type: Plain text
8321 #: build/C/man2/rename.2:133
8322 msgid ""
8323 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
8324 "use by some process (perhaps as current working directory, or as root "
8325 "directory, or because it was open for reading) or is in use by the system "
8326 "(for example as mount point), while the system considers this an error.  "
8327 "(Note that there is no requirement to return B<EBUSY> in such "
8328 "cases\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
8329 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
8330 "situations.)"
8331 msgstr ""
8332
8333 #. type: Plain text
8334 #: build/C/man2/rename.2:143
8335 msgid ""
8336 "The new pathname contained a path prefix of the old, or, more generally, an "
8337 "attempt was made to make a directory a subdirectory of itself."
8338 msgstr ""
8339
8340 #. type: Plain text
8341 #: build/C/man2/rename.2:149
8342 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
8343 msgstr ""
8344
8345 #. type: Plain text
8346 #: build/C/man2/rename.2:160
8347 msgid ""
8348 "I<oldpath> already has the maximum number of links to it, or it was a "
8349 "directory and the directory containing I<newpath> has the maximum number of "
8350 "links."
8351 msgstr ""
8352
8353 #. type: Plain text
8354 #: build/C/man2/rename.2:176
8355 msgid ""
8356 "The link named by I<oldpath> does not exist; or, a directory component in "
8357 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
8358 msgstr ""
8359
8360 #. type: Plain text
8361 #: build/C/man2/rename.2:193
8362 msgid ""
8363 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
8364 "a directory.  Or, I<oldpath> is a directory, and I<newpath> exists but is "
8365 "not a directory."
8366 msgstr ""
8367
8368 #. type: TP
8369 #: build/C/man2/rename.2:193
8370 #, no-wrap
8371 msgid "B<ENOTEMPTY> or B<EEXIST>"
8372 msgstr ""
8373
8374 #. type: Plain text
8375 #: build/C/man2/rename.2:197
8376 msgid ""
8377 "I<newpath> is a nonempty directory, that is, contains entries other than "
8378 "\".\" and \"..\"."
8379 msgstr ""
8380
8381 #. type: TP
8382 #: build/C/man2/rename.2:197 build/C/man2/unlink.2:126
8383 #, no-wrap
8384 msgid "B<EPERM> or B<EACCES>"
8385 msgstr ""
8386
8387 #. type: Plain text
8388 #: build/C/man2/rename.2:221
8389 msgid ""
8390 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>)  set and "
8391 "the process's effective user ID is neither the user ID of the file to be "
8392 "deleted nor that of the directory containing it, and the process is not "
8393 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
8394 "I<newpath> is an existing file and the directory containing it has the "
8395 "sticky bit set and the process's effective user ID is neither the user ID of "
8396 "the file to be replaced nor that of the directory containing it, and the "
8397 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
8398 "capability); or the file system containing I<pathname> does not support "
8399 "renaming of the type requested."
8400 msgstr ""
8401
8402 #. type: Plain text
8403 #: build/C/man2/rename.2:232
8404 msgid ""
8405 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
8406 "permits a file system to be mounted at multiple points, but B<rename>()  "
8407 "does not work across different mount points, even if the same file system is "
8408 "mounted on both.)"
8409 msgstr ""
8410
8411 #. type: Plain text
8412 #: build/C/man2/rename.2:234
8413 msgid "4.3BSD, C89, C99, POSIX.1-2001."
8414 msgstr ""
8415
8416 #. type: Plain text
8417 #: build/C/man2/rename.2:245
8418 msgid ""
8419 "On NFS file systems, you can not assume that if the operation failed the "
8420 "file was not renamed.  If the server does the rename operation and then "
8421 "crashes, the retransmitted RPC which will be processed when the server is up "
8422 "again causes a failure.  The application is expected to deal with this.  See "
8423 "B<link>(2)  for a similar problem."
8424 msgstr ""
8425
8426 #. type: Plain text
8427 #: build/C/man2/rename.2:254
8428 msgid ""
8429 "B<mv>(1), B<chmod>(2), B<link>(2), B<renameat>(2), B<symlink>(2), "
8430 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
8431 msgstr ""
8432
8433 #. type: TH
8434 #: build/C/man2/rmdir.2:30
8435 #, no-wrap
8436 msgid "RMDIR"
8437 msgstr ""
8438
8439 #. type: TH
8440 #: build/C/man2/rmdir.2:30
8441 #, no-wrap
8442 msgid "2008-05-08"
8443 msgstr ""
8444
8445 #. type: Plain text
8446 #: build/C/man2/rmdir.2:33
8447 msgid "rmdir - delete a directory"
8448 msgstr ""
8449
8450 #. type: Plain text
8451 #: build/C/man2/rmdir.2:37
8452 msgid "B<int rmdir(const char *>I<pathname>B<);>"
8453 msgstr ""
8454
8455 #. type: Plain text
8456 #: build/C/man2/rmdir.2:40
8457 msgid "B<rmdir>()  deletes a directory, which must be empty."
8458 msgstr ""
8459
8460 #. type: Plain text
8461 #: build/C/man2/rmdir.2:55
8462 msgid ""
8463 "Write access to the directory containing I<pathname> was not allowed, or one "
8464 "of the directories in the path prefix of I<pathname> did not allow search "
8465 "permission.  (See also B<path_resolution>(7)."
8466 msgstr ""
8467
8468 #. type: Plain text
8469 #: build/C/man2/rmdir.2:64
8470 msgid ""
8471 "I<pathname> is currently in use by the system or some process that prevents "
8472 "its removal.  On Linux this means I<pathname> is currently used as a mount "
8473 "point or is the root directory of the calling process."
8474 msgstr ""
8475
8476 #. type: Plain text
8477 #: build/C/man2/rmdir.2:73
8478 msgid "I<pathname> has I<.> as last component."
8479 msgstr ""
8480
8481 #. type: Plain text
8482 #: build/C/man2/rmdir.2:77
8483 msgid "Too many symbolic links were encountered in resolving I<pathname>."
8484 msgstr ""
8485
8486 #. type: Plain text
8487 #: build/C/man2/rmdir.2:85
8488 msgid ""
8489 "A directory component in I<pathname> does not exist or is a dangling "
8490 "symbolic link."
8491 msgstr ""
8492
8493 #. type: Plain text
8494 #: build/C/man2/rmdir.2:94
8495 msgid ""
8496 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
8497 "fact, a directory."
8498 msgstr ""
8499
8500 #. type: TP
8501 #: build/C/man2/rmdir.2:94
8502 #, no-wrap
8503 msgid "B<ENOTEMPTY>"
8504 msgstr ""
8505
8506 #. type: Plain text
8507 #: build/C/man2/rmdir.2:107
8508 msgid ""
8509 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
8510 "I<..> as its final component.  POSIX.1-2001 also allows B<EEXIST> for this "
8511 "condition."
8512 msgstr ""
8513
8514 #. type: Plain text
8515 #: build/C/man2/rmdir.2:118
8516 msgid ""
8517 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
8518 "and the process's effective user ID is neither the user ID of the file to be "
8519 "deleted nor that of the directory containing it, and the process is not "
8520 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
8521 msgstr ""
8522
8523 #. type: Plain text
8524 #: build/C/man2/rmdir.2:123
8525 msgid ""
8526 "The file system containing I<pathname> does not support the removal of "
8527 "directories."
8528 msgstr ""
8529
8530 #. type: Plain text
8531 #: build/C/man2/rmdir.2:127
8532 msgid "I<pathname> refers to a directory on a read-only file system."
8533 msgstr ""
8534
8535 #. type: Plain text
8536 #: build/C/man2/rmdir.2:132
8537 msgid ""
8538 "Infelicities in the protocol underlying NFS can cause the unexpected "
8539 "disappearance of directories which are still being used."
8540 msgstr ""
8541
8542 #. type: Plain text
8543 #: build/C/man2/rmdir.2:141
8544 msgid ""
8545 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
8546 "B<unlink>(2), B<unlinkat>(2)"
8547 msgstr ""
8548
8549 #. type: TH
8550 #: build/C/man3/scanf.3:52
8551 #, no-wrap
8552 msgid "SCANF"
8553 msgstr ""
8554
8555 #. type: TH
8556 #: build/C/man3/scanf.3:52
8557 #, no-wrap
8558 msgid "2013-01-30"
8559 msgstr ""
8560
8561 #. type: Plain text
8562 #: build/C/man3/scanf.3:55
8563 msgid "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
8564 msgstr ""
8565
8566 #. type: Plain text
8567 #: build/C/man3/scanf.3:62
8568 #, no-wrap
8569 msgid ""
8570 "B<int scanf(const char *>I<format>B<, ...);>\n"
8571 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
8572 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
8573 msgstr ""
8574
8575 #. type: Plain text
8576 #: build/C/man3/scanf.3:64
8577 #, no-wrap
8578 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
8579 msgstr ""
8580
8581 #. type: Plain text
8582 #: build/C/man3/scanf.3:68
8583 #, no-wrap
8584 msgid ""
8585 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
8586 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list "
8587 ">I<ap>B<);>\n"
8588 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
8589 ">I<ap>B<);>\n"
8590 msgstr ""
8591
8592 #. type: Plain text
8593 #: build/C/man3/scanf.3:79
8594 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
8595 msgstr ""
8596
8597 #. type: Plain text
8598 #: build/C/man3/scanf.3:82
8599 msgid ""
8600 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
8601 "200112L;"
8602 msgstr ""
8603
8604 #. type: Plain text
8605 #: build/C/man3/scanf.3:104
8606 msgid ""
8607 "The B<scanf>()  family of functions scans input according to I<format> as "
8608 "described below.  This format may contain I<conversion specifications>; the "
8609 "results from such conversions, if any, are stored in the locations pointed "
8610 "to by the I<pointer> arguments that follow I<format>.  Each I<pointer> "
8611 "argument must be of a type that is appropriate for the value returned by the "
8612 "corresponding conversion specification."
8613 msgstr ""
8614
8615 #. type: Plain text
8616 #: build/C/man3/scanf.3:115
8617 msgid ""
8618 "If the number of conversion specifications in I<format> exceeds the number "
8619 "of I<pointer> arguments, the results are undefined.  If the number of "
8620 "I<pointer> arguments exceeds the number of conversion specifications, then "
8621 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
8622 msgstr ""
8623
8624 #. type: Plain text
8625 #: build/C/man3/scanf.3:127
8626 msgid ""
8627 "The B<scanf>()  function reads input from the standard input stream "
8628 "I<stdin>, B<fscanf>()  reads input from the stream pointer I<stream>, and "
8629 "B<sscanf>()  reads its input from the character string pointed to by I<str>."
8630 msgstr ""
8631
8632 #. type: Plain text
8633 #: build/C/man3/scanf.3:145
8634 msgid ""
8635 "The B<vfscanf>()  function is analogous to B<vfprintf>(3)  and reads input "
8636 "from the stream pointer I<stream> using a variable argument list of pointers "
8637 "(see B<stdarg>(3).  The B<vscanf>()  function scans a variable argument list "
8638 "from the standard input and the B<vsscanf>()  function scans it from a "
8639 "string; these are analogous to the B<vprintf>(3)  and B<vsprintf>(3)  "
8640 "functions respectively."
8641 msgstr ""
8642
8643 #. type: Plain text
8644 #: build/C/man3/scanf.3:159
8645 msgid ""
8646 "The I<format> string consists of a sequence of I<directives> which describe "
8647 "how to process the sequence of input characters.  If processing of a "
8648 "directive fails, no further input is read, and B<scanf>()  returns.  A "
8649 "\"failure\" can be either of the following: I<input failure>, meaning that "
8650 "input characters were unavailable, or I<matching failure>, meaning that the "
8651 "input was inappropriate (see below)."
8652 msgstr ""
8653
8654 #. type: Plain text
8655 #: build/C/man3/scanf.3:161
8656 msgid "A directive is one of the following:"
8657 msgstr ""
8658
8659 #. type: TP
8660 #: 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
8661 #, no-wrap
8662 msgid "\\(bu"
8663 msgstr ""
8664
8665 #. type: Plain text
8666 #: build/C/man3/scanf.3:167
8667 msgid ""
8668 "A sequence of white-space characters (space, tab, newline, etc.; see "
8669 "B<isspace>(3)).  This directive matches any amount of white space, including "
8670 "none, in the input."
8671 msgstr ""
8672
8673 #. type: Plain text
8674 #: build/C/man3/scanf.3:171
8675 msgid ""
8676 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq).  "
8677 "This character must exactly match the next character of input."
8678 msgstr ""
8679
8680 #. type: Plain text
8681 #: build/C/man3/scanf.3:182
8682 msgid ""
8683 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
8684 "character.  A sequence of characters from the input is converted according "
8685 "to this specification, and the result is placed in the corresponding "
8686 "I<pointer> argument.  If the next item of input does not match the "
8687 "conversion specification, the conversion fails\\(emthis is a I<matching "
8688 "failure>."
8689 msgstr ""
8690
8691 #. type: Plain text
8692 #: build/C/man3/scanf.3:190
8693 msgid ""
8694 "Each I<conversion specification> in I<format> begins with either the "
8695 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
8696 "for the distinction) followed by:"
8697 msgstr ""
8698
8699 #. type: Plain text
8700 #: build/C/man3/scanf.3:201
8701 msgid ""
8702 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>()  reads "
8703 "input as directed by the conversion specification, but discards the input.  "
8704 "No corresponding I<pointer> argument is required, and this specification is "
8705 "not included in the count of successful assignments returned by B<scanf>()."
8706 msgstr ""
8707
8708 #. type: Plain text
8709 #: build/C/man3/scanf.3:220
8710 msgid ""
8711 "An optional \\(aqm\\(aq character.  This is used with string conversions "
8712 "(I<%s>, I<%c>, I<%[>), and relieves the caller of the need to allocate a "
8713 "corresponding buffer to hold the input: instead, B<scanf>()  allocates a "
8714 "buffer of sufficient size, and assigns the address of this buffer to the "
8715 "corresponding I<pointer> argument, which should be a pointer to a I<char *> "
8716 "variable (this variable does not need to be initialized before the call).  "
8717 "The caller should subsequently B<free>(3)  this buffer when it is no longer "
8718 "required."
8719 msgstr ""
8720
8721 #. type: Plain text
8722 #: build/C/man3/scanf.3:232
8723 msgid ""
8724 "An optional decimal integer which specifies the I<maximum field width>.  "
8725 "Reading of characters stops either when this maximum is reached or when a "
8726 "nonmatching character is found, whichever happens first.  Most conversions "
8727 "discard initial white space characters (the exceptions are noted below), and "
8728 "these discarded characters don't count toward the maximum field width.  "
8729 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq)  to "
8730 "mark the end of the input; the maximum field width does not include this "
8731 "terminator."
8732 msgstr ""
8733
8734 #. type: Plain text
8735 #: build/C/man3/scanf.3:246
8736 msgid ""
8737 "An optional I<type modifier character>.  For example, the B<l> type modifier "
8738 "is used with integer conversions such as B<%d> to specify that the "
8739 "corresponding I<pointer> argument refers to a I<long int> rather than a "
8740 "pointer to an I<int>."
8741 msgstr ""
8742
8743 #. type: Plain text
8744 #: build/C/man3/scanf.3:251
8745 msgid ""
8746 "A I<conversion specifier> that specifies the type of input conversion to be "
8747 "performed."
8748 msgstr ""
8749
8750 #. type: Plain text
8751 #: build/C/man3/scanf.3:280
8752 msgid ""
8753 "The conversion specifications in I<format> are of two forms, either "
8754 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\".  The two "
8755 "forms should not be mixed in the same I<format> string, except that a string "
8756 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>.  If "
8757 "I<format> contains \\(aq%\\(aq specifications then these correspond in order "
8758 "with successive I<pointer> arguments.  In the \"B<%>I<n>B<$>\" form (which "
8759 "is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer that "
8760 "specifies that the converted input should be placed in the location referred "
8761 "to by the I<n>-th I<pointer> argument following I<format>."
8762 msgstr ""
8763
8764 #. type: SS
8765 #: build/C/man3/scanf.3:280
8766 #, no-wrap
8767 msgid "Conversions"
8768 msgstr ""
8769
8770 #. type: Plain text
8771 #: build/C/man3/scanf.3:284
8772 msgid ""
8773 "The following I<type modifier characters> can appear in a conversion "
8774 "specification:"
8775 msgstr ""
8776
8777 #. type: Plain text
8778 #: build/C/man3/scanf.3:294
8779 msgid ""
8780 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
8781 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
8782 "I<unsigned short int> (rather than I<int>)."
8783 msgstr ""
8784
8785 #. type: Plain text
8786 #: build/C/man3/scanf.3:302
8787 msgid ""
8788 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
8789 "I<unsigned char>."
8790 msgstr ""
8791
8792 #. type: Plain text
8793 #: build/C/man3/scanf.3:311
8794 msgid ""
8795 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
8796 "I<uintmax_t>.  This modifier was introduced in C99."
8797 msgstr ""
8798
8799 #.  This use of l was introduced in Amendment 1 to ISO C90.
8800 #. type: Plain text
8801 #: build/C/man3/scanf.3:338
8802 msgid ""
8803 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
8804 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
8805 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
8806 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
8807 "(rather than I<float>).  Specifying two B<l> characters is equivalent to "
8808 "B<L>.  If used with B<%c> or B<%s> the corresponding parameter is considered "
8809 "as a pointer to a wide character or wide-character string respectively."
8810 msgstr ""
8811
8812 #.  MTK, Jul 05: The following is no longer true for modern
8813 #.  ANSI C (i.e., C99):
8814 #.  (Note that long long is not an
8815 #.  ANSI C
8816 #.  type. Any program using this will not be portable to all
8817 #.  architectures).
8818 #. type: Plain text
8819 #: build/C/man3/scanf.3:354
8820 msgid ""
8821 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
8822 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
8823 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
8824 msgstr ""
8825
8826 #. type: Plain text
8827 #: build/C/man3/scanf.3:359
8828 msgid "equivalent to B<L>.  This specifier does not exist in ANSI C."
8829 msgstr ""
8830
8831 #. type: Plain text
8832 #: build/C/man3/scanf.3:366
8833 msgid ""
8834 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>.  This "
8835 "modifier was introduced in C99."
8836 msgstr ""
8837
8838 #. type: Plain text
8839 #: build/C/man3/scanf.3:373
8840 msgid ""
8841 "As for B<h>, but the next pointer is a pointer to a I<size_t>.  This "
8842 "modifier was introduced in C99."
8843 msgstr ""
8844
8845 #. type: Plain text
8846 #: build/C/man3/scanf.3:377
8847 msgid "The following I<conversion specifiers> are available:"
8848 msgstr ""
8849
8850 #. type: Plain text
8851 #: build/C/man3/scanf.3:386
8852 msgid ""
8853 "Matches a literal \\(aq%\\(aq.  That is, B<%\\&%> in the format string "
8854 "matches a single input \\(aq%\\(aq character.  No conversion is done (but "
8855 "initial white space characters are discarded), and assignment does not "
8856 "occur."
8857 msgstr ""
8858
8859 #. type: TP
8860 #: build/C/man3/scanf.3:386
8861 #, no-wrap
8862 msgid "B<d>"
8863 msgstr ""
8864
8865 #. type: Plain text
8866 #: build/C/man3/scanf.3:391
8867 msgid ""
8868 "Matches an optionally signed decimal integer; the next pointer must be a "
8869 "pointer to I<int>."
8870 msgstr ""
8871
8872 #. type: TP
8873 #: build/C/man3/scanf.3:391
8874 #, no-wrap
8875 msgid "B<D>"
8876 msgstr ""
8877
8878 #. type: Plain text
8879 #: build/C/man3/scanf.3:400
8880 msgid ""
8881 "Equivalent to I<ld>; this exists only for backward compatibility.  (Note: "
8882 "thus only in libc4.  In libc5 and glibc the B<%D> is silently ignored, "
8883 "causing old programs to fail mysteriously.)"
8884 msgstr ""
8885
8886 #. type: TP
8887 #: build/C/man3/scanf.3:400
8888 #, no-wrap
8889 msgid "B<i>"
8890 msgstr ""
8891
8892 #. type: Plain text
8893 #: build/C/man3/scanf.3:412
8894 msgid ""
8895 "Matches an optionally signed integer; the next pointer must be a pointer to "
8896 "I<int>.  The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
8897 "base 8 if it begins with I<0>, and in base 10 otherwise.  Only characters "
8898 "that correspond to the base are used."
8899 msgstr ""
8900
8901 #. type: TP
8902 #: build/C/man3/scanf.3:412
8903 #, no-wrap
8904 msgid "B<o>"
8905 msgstr ""
8906
8907 #. type: Plain text
8908 #: build/C/man3/scanf.3:416
8909 msgid ""
8910 "Matches an unsigned octal integer; the next pointer must be a pointer to "
8911 "I<unsigned int>."
8912 msgstr ""
8913
8914 #. type: TP
8915 #: build/C/man3/scanf.3:416
8916 #, no-wrap
8917 msgid "B<u>"
8918 msgstr ""
8919
8920 #. type: Plain text
8921 #: build/C/man3/scanf.3:421
8922 msgid ""
8923 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
8924 "I<unsigned int>."
8925 msgstr ""
8926
8927 #. type: Plain text
8928 #: build/C/man3/scanf.3:426
8929 msgid ""
8930 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
8931 "to I<unsigned int>."
8932 msgstr ""
8933
8934 #. type: TP
8935 #: build/C/man3/scanf.3:426
8936 #, no-wrap
8937 msgid "B<X>"
8938 msgstr ""
8939
8940 #. type: Plain text
8941 #: build/C/man3/scanf.3:430
8942 msgid "Equivalent to B<x>."
8943 msgstr ""
8944
8945 #. type: TP
8946 #: build/C/man3/scanf.3:430
8947 #, no-wrap
8948 msgid "B<f>"
8949 msgstr ""
8950
8951 #. type: Plain text
8952 #: build/C/man3/scanf.3:435
8953 msgid ""
8954 "Matches an optionally signed floating-point number; the next pointer must be "
8955 "a pointer to I<float>."
8956 msgstr ""
8957
8958 #. type: TP
8959 #: build/C/man3/scanf.3:435
8960 #, no-wrap
8961 msgid "B<e>"
8962 msgstr ""
8963
8964 #. type: Plain text
8965 #: build/C/man3/scanf.3:439 build/C/man3/scanf.3:443 build/C/man3/scanf.3:447
8966 msgid "Equivalent to B<f>."
8967 msgstr ""
8968
8969 #. type: TP
8970 #: build/C/man3/scanf.3:439
8971 #, no-wrap
8972 msgid "B<g>"
8973 msgstr ""
8974
8975 #. type: TP
8976 #: build/C/man3/scanf.3:443
8977 #, no-wrap
8978 msgid "B<E>"
8979 msgstr ""
8980
8981 #. type: Plain text
8982 #: build/C/man3/scanf.3:451
8983 msgid "(C99) Equivalent to B<f>."
8984 msgstr ""
8985
8986 #. type: Plain text
8987 #: build/C/man3/scanf.3:459
8988 msgid ""
8989 "Matches a sequence of non-white-space characters; the next pointer must be a "
8990 "pointer to character array that is long enough to hold the input sequence "
8991 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
8992 "automatically.  The input string stops at white space or at the maximum "
8993 "field width, whichever occurs first."
8994 msgstr ""
8995
8996 #. type: Plain text
8997 #: build/C/man3/scanf.3:470
8998 msgid ""
8999 "Matches a sequence of characters whose length is specified by the I<maximum "
9000 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
9001 "there must be enough room for all the characters (no terminating null byte "
9002 "is added).  The usual skip of leading white space is suppressed.  To skip "
9003 "white space first, use an explicit space in the format."
9004 msgstr ""
9005
9006 #. type: TP
9007 #: build/C/man3/scanf.3:470
9008 #, no-wrap
9009 msgid "B<\\&[>"
9010 msgstr ""
9011
9012 #. type: Plain text
9013 #: build/C/man3/scanf.3:503
9014 msgid ""
9015 "Matches a nonempty sequence of characters from the specified set of accepted "
9016 "characters; the next pointer must be a pointer to I<char>, and there must be "
9017 "enough room for all the characters in the string, plus a terminating null "
9018 "byte.  The usual skip of leading white space is suppressed.  The string is "
9019 "to be made up of characters in (or not in) a particular set; the set is "
9020 "defined by the characters between the open bracket B<[> character and a "
9021 "close bracket B<]> character.  The set I<excludes> those characters if the "
9022 "first character after the open bracket is a circumflex (B<^>).  To include a "
9023 "close bracket in the set, make it the first character after the open bracket "
9024 "or the circumflex; any other position will end the set.  The hyphen "
9025 "character B<-> is also special; when placed between two other characters, it "
9026 "adds all intervening characters to the set.  To include a hyphen, make it "
9027 "the last character before the final close bracket.  For instance, "
9028 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
9029 "nine, and hyphen\".  The string ends with the appearance of a character not "
9030 "in the (or, with a circumflex, in) set or when the field width runs out."
9031 msgstr ""
9032
9033 #. type: Plain text
9034 #: build/C/man3/scanf.3:511
9035 msgid ""
9036 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
9037 "pointer must be a pointer to a pointer to I<void>."
9038 msgstr ""
9039
9040 #. type: Plain text
9041 #: build/C/man3/scanf.3:531
9042 msgid ""
9043 "Nothing is expected; instead, the number of characters consumed thus far "
9044 "from the input is stored through the next pointer, which must be a pointer "
9045 "to I<int>.  This is I<not> a conversion, although it can be suppressed with "
9046 "the B<*> assignment-suppression character.  The C standard says: \"Execution "
9047 "of a B<%n> directive does not increment the assignment count returned at the "
9048 "completion of execution\" but the Corrigendum seems to contradict this.  "
9049 "Probably it is wise not to make any assumptions on the effect of B<%n> "
9050 "conversions on the return value."
9051 msgstr ""
9052
9053 #. type: Plain text
9054 #: build/C/man3/scanf.3:536
9055 msgid ""
9056 "These functions return the number of input items successfully matched and "
9057 "assigned, which can be fewer than provided for, or even zero in the event of "
9058 "an early matching failure."
9059 msgstr ""
9060
9061 #. type: Plain text
9062 #: build/C/man3/scanf.3:548
9063 msgid ""
9064 "The value B<EOF> is returned if the end of input is reached before either "
9065 "the first successful conversion or a matching failure occurs.  B<EOF> is "
9066 "also returned if a read error occurs, in which case the error indicator for "
9067 "the stream (see B<ferror>(3))  is set, and I<errno> is set indicate the "
9068 "error."
9069 msgstr ""
9070
9071 #. type: Plain text
9072 #: build/C/man3/scanf.3:554
9073 msgid ""
9074 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
9075 "operation would block."
9076 msgstr ""
9077
9078 #. type: Plain text
9079 #: build/C/man3/scanf.3:559
9080 msgid ""
9081 "The file descriptor underlying I<stream> is invalid, or not open for "
9082 "reading."
9083 msgstr ""
9084
9085 #. type: Plain text
9086 #: build/C/man3/scanf.3:562
9087 msgid "Input byte sequence does not form a valid character."
9088 msgstr ""
9089
9090 #. type: Plain text
9091 #: build/C/man3/scanf.3:566
9092 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
9093 msgstr ""
9094
9095 #. type: Plain text
9096 #: build/C/man3/scanf.3:571
9097 msgid "Not enough arguments; or I<format> is NULL."
9098 msgstr ""
9099
9100 #. type: Plain text
9101 #: build/C/man3/scanf.3:574
9102 msgid "Out of memory."
9103 msgstr ""
9104
9105 #. type: TP
9106 #: build/C/man3/scanf.3:574
9107 #, no-wrap
9108 msgid "B<ERANGE>"
9109 msgstr ""
9110
9111 #. type: Plain text
9112 #: build/C/man3/scanf.3:578
9113 msgid ""
9114 "The result of an integer conversion would exceed the size that can be stored "
9115 "in the corresponding integer type."
9116 msgstr ""
9117
9118 #. type: Plain text
9119 #: build/C/man3/scanf.3:588
9120 msgid ""
9121 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>()  conform to C89 and "
9122 "C99 and POSIX.1-2001.  These standards do not specify the B<ERANGE> error."
9123 msgstr ""
9124
9125 #. type: Plain text
9126 #: build/C/man3/scanf.3:598
9127 msgid ""
9128 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
9129 "the usage of B<L> in integer conversions is the GNU notation."
9130 msgstr ""
9131
9132 #. type: Plain text
9133 #: build/C/man3/scanf.3:609
9134 msgid ""
9135 "The Linux version of these functions is based on the I<GNU> I<libio> "
9136 "library.  Take a look at the I<info> documentation of I<GNU> I<libc "
9137 "(glibc-1.08)> for a more concise description."
9138 msgstr ""
9139
9140 #. type: Plain text
9141 #: build/C/man3/scanf.3:615
9142 msgid ""
9143 "The GNU C library supported the dynamic allocation conversion specifier (as "
9144 "a nonstandard extension) via the B<a> character.  This feature seems to be "
9145 "present at least as far back as glibc 2.0."
9146 msgstr ""
9147
9148 #. type: Plain text
9149 #: build/C/man3/scanf.3:625
9150 msgid ""
9151 "It is not available if the program is compiled with I<gcc -std=c99> or I<gcc "
9152 "-D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also specified), in which case "
9153 "the B<a> is interpreted as a specifier for floating-point numbers (see "
9154 "above)."
9155 msgstr ""
9156
9157 #. type: Plain text
9158 #: build/C/man3/scanf.3:634
9159 msgid ""
9160 "Since version 2.7, glibc also provides the B<m> modifier for the same "
9161 "purpose as the B<a> modifier.  The B<m> modifier has the following "
9162 "advantages:"
9163 msgstr ""
9164
9165 #. type: Plain text
9166 #: build/C/man3/scanf.3:639
9167 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
9168 msgstr ""
9169
9170 #. type: Plain text
9171 #: build/C/man3/scanf.3:645
9172 msgid ""
9173 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
9174 "specifier (and is unaffected by I<gcc -std=c99> etc.)"
9175 msgstr ""
9176
9177 #. type: Plain text
9178 #: build/C/man3/scanf.3:647
9179 msgid "It is specified in the POSIX.1-2008 standard."
9180 msgstr ""
9181
9182 #. type: Plain text
9183 #: build/C/man3/scanf.3:660
9184 msgid ""
9185 "All functions are fully C89 conformant, but provide the additional "
9186 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
9187 "B<l> specifiers.  The latter may be considered to be a bug, as it changes "
9188 "the behavior of specifiers defined in C89."
9189 msgstr ""
9190
9191 #. type: Plain text
9192 #: build/C/man3/scanf.3:676
9193 msgid ""
9194 "Some combinations of the type modifiers and conversion specifiers defined by "
9195 "ANSI C do not make sense (e.g., B<%Ld>).  While they may have a well-defined "
9196 "behavior on Linux, this need not to be so on other architectures.  Therefore "
9197 "it usually is better to use modifiers that are not defined by ANSI C at all, "
9198 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
9199 "B<u>, B<x>, and B<X> conversions or B<ll>."
9200 msgstr ""
9201
9202 #. type: Plain text
9203 #: build/C/man3/scanf.3:682
9204 msgid ""
9205 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
9206 "conversions equivalently to B<L>."
9207 msgstr ""
9208
9209 #. type: Plain text
9210 #: build/C/man3/scanf.3:692
9211 msgid ""
9212 "To use the dynamic allocation conversion specifier, specify B<m> as a length "
9213 "modifier (thus B<%ms> or B<%m[>I<range>B<]>).  The caller must B<free>(3)  "
9214 "the returned string, as in the following example:"
9215 msgstr ""
9216
9217 #. type: Plain text
9218 #: build/C/man3/scanf.3:697
9219 #, no-wrap
9220 msgid ""
9221 "char *p;\n"
9222 "int n;\n"
9223 msgstr ""
9224
9225 #. type: Plain text
9226 #: build/C/man3/scanf.3:708
9227 #, no-wrap
9228 msgid ""
9229 "errno = 0;\n"
9230 "n = scanf(\"%m[a-z]\", &p);\n"
9231 "if (n == 1) {\n"
9232 "    printf(\"read: %s\\en\", p);\n"
9233 "    free(p);\n"
9234 "} else if (errno != 0) {\n"
9235 "    perror(\"scanf\");\n"
9236 "} else {\n"
9237 "    fprintf(stderr, \"No matching characters\\en\");\n"
9238 "}\n"
9239 msgstr ""
9240
9241 #. type: Plain text
9242 #: build/C/man3/scanf.3:716
9243 msgid ""
9244 "As shown in the above example, it is only necessary to call B<free>(3)  if "
9245 "the B<scanf>()  call successfully read a string."
9246 msgstr ""
9247
9248 #. type: Plain text
9249 #: build/C/man3/scanf.3:723
9250 msgid ""
9251 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
9252 "B<strtoul>(3)"
9253 msgstr ""
9254
9255 #. type: TH
9256 #: build/C/man3/setbuf.3:48
9257 #, no-wrap
9258 msgid "SETBUF"
9259 msgstr ""
9260
9261 #. type: TH
9262 #: build/C/man3/setbuf.3:48
9263 #, no-wrap
9264 msgid "2012-08-03"
9265 msgstr ""
9266
9267 #. type: Plain text
9268 #: build/C/man3/setbuf.3:51
9269 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
9270 msgstr ""
9271
9272 #. type: Plain text
9273 #: build/C/man3/setbuf.3:56
9274 #, no-wrap
9275 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
9276 msgstr ""
9277
9278 #. type: Plain text
9279 #: build/C/man3/setbuf.3:58
9280 #, no-wrap
9281 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
9282 msgstr ""
9283
9284 #. type: Plain text
9285 #: build/C/man3/setbuf.3:60
9286 #, no-wrap
9287 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
9288 msgstr ""
9289
9290 #. type: Plain text
9291 #: build/C/man3/setbuf.3:63
9292 #, no-wrap
9293 msgid ""
9294 "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t "
9295 ">I<size>B<);>\n"
9296 msgstr ""
9297
9298 #. type: Plain text
9299 #: build/C/man3/setbuf.3:73
9300 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
9301 msgstr ""
9302
9303 #. type: Plain text
9304 #: build/C/man3/setbuf.3:96
9305 msgid ""
9306 "The three types of buffering available are unbuffered, block buffered, and "
9307 "line buffered.  When an output stream is unbuffered, information appears on "
9308 "the destination file or terminal as soon as written; when it is block "
9309 "buffered many characters are saved up and written as a block; when it is "
9310 "line buffered characters are saved up until a newline is output or input is "
9311 "read from any stream attached to a terminal device (typically I<stdin>).  "
9312 "The function B<fflush>(3)  may be used to force the block out early.  (See "
9313 "B<fclose>(3).)  Normally all files are block buffered.  When the first I/O "
9314 "operation occurs on a file, B<malloc>(3)  is called, and a buffer is "
9315 "obtained.  If a stream refers to a terminal (as I<stdout> normally does) it "
9316 "is line buffered.  The standard error stream I<stderr> is always unbuffered "
9317 "by default."
9318 msgstr ""
9319
9320 #. type: Plain text
9321 #: build/C/man3/setbuf.3:103
9322 msgid ""
9323 "The B<setvbuf>()  function may be used on any open stream to change its "
9324 "buffer.  The I<mode> argument must be one of the following three macros:"
9325 msgstr ""
9326
9327 #. type: TP
9328 #: build/C/man3/setbuf.3:104
9329 #, no-wrap
9330 msgid "B<_IONBF>"
9331 msgstr ""
9332
9333 #. type: Plain text
9334 #: build/C/man3/setbuf.3:107
9335 msgid "unbuffered"
9336 msgstr ""
9337
9338 #. type: TP
9339 #: build/C/man3/setbuf.3:107
9340 #, no-wrap
9341 msgid "B<_IOLBF>"
9342 msgstr ""
9343
9344 #. type: Plain text
9345 #: build/C/man3/setbuf.3:110
9346 msgid "line buffered"
9347 msgstr ""
9348
9349 #. type: TP
9350 #: build/C/man3/setbuf.3:110
9351 #, no-wrap
9352 msgid "B<_IOFBF>"
9353 msgstr ""
9354
9355 #. type: Plain text
9356 #: build/C/man3/setbuf.3:113
9357 msgid "fully buffered"
9358 msgstr ""
9359
9360 #. type: Plain text
9361 #: build/C/man3/setbuf.3:129
9362 msgid ""
9363 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
9364 "least I<size> bytes long; this buffer will be used instead of the current "
9365 "buffer.  If the argument I<buf> is NULL, only the mode is affected; a new "
9366 "buffer will be allocated on the next read or write operation.  The "
9367 "B<setvbuf>()  function may only be used after opening a stream and before "
9368 "any other operations have been performed on it."
9369 msgstr ""
9370
9371 #. type: Plain text
9372 #: build/C/man3/setbuf.3:135
9373 msgid ""
9374 "The other three calls are, in effect, simply aliases for calls to "
9375 "B<setvbuf>().  The B<setbuf>()  function is exactly equivalent to the call"
9376 msgstr ""
9377
9378 #. type: Plain text
9379 #: build/C/man3/setbuf.3:138
9380 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
9381 msgstr ""
9382
9383 #. type: Plain text
9384 #: build/C/man3/setbuf.3:148
9385 msgid ""
9386 "The B<setbuffer>()  function is the same, except that the size of the buffer "
9387 "is up to the caller, rather than being determined by the default B<BUFSIZ>.  "
9388 "The B<setlinebuf>()  function is exactly equivalent to the call:"
9389 msgstr ""
9390
9391 #. type: Plain text
9392 #: build/C/man3/setbuf.3:151
9393 msgid "setvbuf(stream, NULL, _IOLBF, 0);"
9394 msgstr ""
9395
9396 #. type: Plain text
9397 #: build/C/man3/setbuf.3:162
9398 msgid ""
9399 "The function B<setvbuf>()  returns 0 on success.  It returns nonzero on "
9400 "failure (I<mode> is invalid or the request cannot be honored).  It may set "
9401 "I<errno> on failure."
9402 msgstr ""
9403
9404 #. type: Plain text
9405 #: build/C/man3/setbuf.3:164
9406 msgid "The other functions do not return a value."
9407 msgstr ""
9408
9409 #. type: Plain text
9410 #: build/C/man3/setbuf.3:170
9411 msgid "The B<setbuf>()  and B<setvbuf>()  functions conform to C89 and C99."
9412 msgstr ""
9413
9414 #. type: Plain text
9415 #: build/C/man3/setbuf.3:180
9416 msgid ""
9417 "The B<setbuffer>()  and B<setlinebuf>()  functions are not portable to "
9418 "versions of BSD before 4.2BSD, and are available under Linux since libc "
9419 "4.5.21.  On 4.2BSD and 4.3BSD systems, B<setbuf>()  always uses a suboptimal "
9420 "buffer size and should be avoided."
9421 msgstr ""
9422
9423 #. type: Plain text
9424 #: build/C/man3/setbuf.3:187
9425 msgid ""
9426 "You must make sure that the space that I<buf> points to still exists by the "
9427 "time I<stream> is closed, which also happens at program termination.  For "
9428 "example, the following is invalid:"
9429 msgstr ""
9430
9431 #. type: Plain text
9432 #: build/C/man3/setbuf.3:190
9433 #, no-wrap
9434 msgid "#include E<lt>stdio.hE<gt>\n"
9435 msgstr ""
9436
9437 #. type: Plain text
9438 #: build/C/man3/setbuf.3:199
9439 #, no-wrap
9440 msgid ""
9441 "int\n"
9442 "main(void)\n"
9443 "{\n"
9444 "    char buf[BUFSIZ];\n"
9445 "    setbuf(stdin, buf);\n"
9446 "    printf(\"Hello, world!\\en\");\n"
9447 "    return 0;\n"
9448 "}\n"
9449 msgstr ""
9450
9451 #. type: Plain text
9452 #: build/C/man3/setbuf.3:208
9453 msgid ""
9454 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
9455 "B<printf>(3), B<puts>(3)"
9456 msgstr ""
9457
9458 #. type: TH
9459 #: build/C/man3/stdin.3:13
9460 #, no-wrap
9461 msgid "STDIN"
9462 msgstr ""
9463
9464 #. type: TH
9465 #: build/C/man3/stdin.3:13 build/C/man3/tmpfile.3:31
9466 #, no-wrap
9467 msgid "2008-07-14"
9468 msgstr ""
9469
9470 #. type: Plain text
9471 #: build/C/man3/stdin.3:16
9472 msgid "stdin, stdout, stderr - standard I/O streams"
9473 msgstr ""
9474
9475 #. type: Plain text
9476 #: build/C/man3/stdin.3:23
9477 #, no-wrap
9478 msgid ""
9479 "B<extern FILE *>I<stdin>B<;>\n"
9480 "B<extern FILE *>I<stdout>B<;>\n"
9481 "B<extern FILE *>I<stderr>B<;>\n"
9482 msgstr ""
9483
9484 #. type: Plain text
9485 #: build/C/man3/stdin.3:35
9486 msgid ""
9487 "Under normal circumstances every UNIX program has three streams opened for "
9488 "it when it starts up, one for input, one for output, and one for printing "
9489 "diagnostic or error messages.  These are typically attached to the user's "
9490 "terminal (see B<tty>(4)  but might instead refer to files or other devices, "
9491 "depending on what the parent process chose to set up.  (See also the "
9492 "\"Redirection\" section of B<sh>(1).)"
9493 msgstr ""
9494
9495 #. type: Plain text
9496 #: build/C/man3/stdin.3:45
9497 msgid ""
9498 "The input stream is referred to as \"standard input\"; the output stream is "
9499 "referred to as \"standard output\"; and the error stream is referred to as "
9500 "\"standard error\".  These terms are abbreviated to form the symbols used to "
9501 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
9502 msgstr ""
9503
9504 #. type: Plain text
9505 #: build/C/man3/stdin.3:54
9506 msgid ""
9507 "Each of these symbols is a B<stdio>(3)  macro of type pointer to I<FILE>, "
9508 "and can be used with functions like B<fprintf>(3)  or B<fread>(3)."
9509 msgstr ""
9510
9511 #. type: Plain text
9512 #: build/C/man3/stdin.3:63
9513 msgid ""
9514 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
9515 "same underlying files may also be accessed using the raw UNIX file "
9516 "interface, that is, the functions like B<read>(2)  and B<lseek>(2)."
9517 msgstr ""
9518
9519 #. type: Plain text
9520 #: build/C/man3/stdin.3:82
9521 msgid ""
9522 "On program startup, the integer file descriptors associated with the streams "
9523 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively.  The "
9524 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
9525 "are defined with these values in I<E<lt>unistd.hE<gt>>.  (Applying "
9526 "B<freopen>(3)  to one of these streams can change the file descriptor number "
9527 "associated with the stream.)"
9528 msgstr ""
9529
9530 #. type: Plain text
9531 #: build/C/man3/stdin.3:95
9532 msgid ""
9533 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
9534 "unexpected results and should generally be avoided.  (For the masochistic "
9535 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
9536 "is supposed to work.)  A general rule is that file descriptors are handled "
9537 "in the kernel, while stdio is just a library.  This means for example, that "
9538 "after an B<exec>(3), the child inherits all open file descriptors, but all "
9539 "old streams have become inaccessible."
9540 msgstr ""
9541
9542 #. type: Plain text
9543 #: build/C/man3/stdin.3:113
9544 msgid ""
9545 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
9546 "macros, assigning to them is nonportable.  The standard streams can be made "
9547 "to refer to different files with help of the library function B<freopen>(3), "
9548 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
9549 "and I<stderr>.  The standard streams are closed by a call to B<exit>(3)  and "
9550 "by normal program termination."
9551 msgstr ""
9552
9553 #. type: Plain text
9554 #: build/C/man3/stdin.3:122
9555 msgid ""
9556 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
9557 "standard also stipulates that these three streams shall be open at program "
9558 "startup."
9559 msgstr ""
9560
9561 #. type: Plain text
9562 #: build/C/man3/stdin.3:154
9563 msgid ""
9564 "The stream I<stderr> is unbuffered.  The stream I<stdout> is line-buffered "
9565 "when it points to a terminal.  Partial lines will not appear until "
9566 "B<fflush>(3)  or B<exit>(3)  is called, or a newline is printed.  This can "
9567 "produce unexpected results, especially with debugging output.  The buffering "
9568 "mode of the standard streams (or any other stream)  can be changed using the "
9569 "B<setbuf>(3)  or B<setvbuf>(3)  call.  Note that in case I<stdin> is "
9570 "associated with a terminal, there may also be input buffering in the "
9571 "terminal driver, entirely unrelated to stdio buffering.  (Indeed, normally "
9572 "terminal input is line buffered in the kernel.)  This kernel input handling "
9573 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
9574 "B<termios>(3)."
9575 msgstr ""
9576
9577 #. type: Plain text
9578 #: build/C/man3/stdin.3:160
9579 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
9580 msgstr ""
9581
9582 #. type: TH
9583 #: build/C/man3/stdio.3:39
9584 #, no-wrap
9585 msgid "STDIO"
9586 msgstr ""
9587
9588 #. type: TH
9589 #: build/C/man3/stdio.3:39
9590 #, no-wrap
9591 msgid "2001-12-26"
9592 msgstr ""
9593
9594 #. type: Plain text
9595 #: build/C/man3/stdio.3:42
9596 msgid "stdio - standard input/output library functions"
9597 msgstr ""
9598
9599 #. type: Plain text
9600 #: build/C/man3/stdio.3:46
9601 msgid "B<FILE *>I<stdin>B<;>"
9602 msgstr ""
9603
9604 #. type: Plain text
9605 #: build/C/man3/stdio.3:48
9606 msgid "B<FILE *>I<stdout>B<;>"
9607 msgstr ""
9608
9609 #. type: Plain text
9610 #: build/C/man3/stdio.3:50
9611 msgid "B<FILE *>I<stderr>B<;>"
9612 msgstr ""
9613
9614 #. type: Plain text
9615 #: build/C/man3/stdio.3:57
9616 msgid ""
9617 "The standard I/O library provides a simple and efficient buffered stream I/O "
9618 "interface.  Input and output is mapped into logical data streams and the "
9619 "physical I/O characteristics are concealed.  The functions and macros are "
9620 "listed below; more information is available from the individual man pages."
9621 msgstr ""
9622
9623 #. type: Plain text
9624 #: build/C/man3/stdio.3:80
9625 msgid ""
9626 "A stream is associated with an external file (which may be a physical "
9627 "device) by I<opening> a file, which may involve creating a new file.  "
9628 "Creating an existing file causes its former contents to be discarded.  If a "
9629 "file can support positioning requests (such as a disk file, as opposed to a "
9630 "terminal) then a I<file position indicator> associated with the stream is "
9631 "positioned at the start of the file (byte zero), unless the file is opened "
9632 "with append mode.  If append mode is used, it is unspecified whether the "
9633 "position indicator will be placed at the start or the end of the file.  The "
9634 "position indicator is maintained by subsequent reads, writes and positioning "
9635 "requests.  All input occurs as if the characters were read by successive "
9636 "calls to the B<fgetc>(3)  function; all output takes place as if all "
9637 "characters were written by successive calls to the B<fputc>(3)  function."
9638 msgstr ""
9639
9640 #. type: Plain text
9641 #: build/C/man3/stdio.3:90
9642 msgid ""
9643 "A file is disassociated from a stream by I<closing> the file.  Output "
9644 "streams are flushed (any unwritten buffer contents are transferred to the "
9645 "host environment) before the stream is disassociated from the file.  The "
9646 "value of a pointer to a I<FILE> object is indeterminate after a file is "
9647 "closed (garbage)."
9648 msgstr ""
9649
9650 #. type: Plain text
9651 #: build/C/man3/stdio.3:103
9652 msgid ""
9653 "A file may be subsequently reopened, by the same or another program "
9654 "execution, and its contents reclaimed or modified (if it can be repositioned "
9655 "at the start).  If the main function returns to its original caller, or the "
9656 "B<exit>(3)  function is called, all open files are closed (hence all output "
9657 "streams are flushed) before program termination.  Other methods of program "
9658 "termination, such as B<abort>(3)  do not bother about closing files "
9659 "properly."
9660 msgstr ""
9661
9662 #. type: Plain text
9663 #: build/C/man3/stdio.3:119
9664 msgid ""
9665 "At program startup, three text streams are predefined and need not be opened "
9666 "explicitly: I<standard input> (for reading conventional input), I<standard "
9667 "output> (for writing conventional input), and I<standard error> (for writing "
9668 "diagnostic output).  These streams are abbreviated I<stdin>,I<stdout> and "
9669 "I<stderr>.  When opened, the standard error stream is not fully buffered; "
9670 "the standard input and output streams are fully buffered if and only if the "
9671 "streams do not refer to an interactive device."
9672 msgstr ""
9673
9674 #. type: Plain text
9675 #: build/C/man3/stdio.3:129
9676 msgid ""
9677 "Output streams that refer to terminal devices are always line buffered by "
9678 "default; pending output to such streams is written automatically whenever an "
9679 "input stream that refers to a terminal device is read.  In cases where a "
9680 "large amount of computation is done after printing part of a line on an "
9681 "output terminal, it is necessary to B<fflush>(3)  the standard output before "
9682 "going off and computing so that the output will appear."
9683 msgstr ""
9684
9685 #. type: Plain text
9686 #: build/C/man3/stdio.3:143
9687 msgid ""
9688 "The I<stdio> library is a part of the library B<libc> and routines are "
9689 "automatically loaded as needed by the compilers B<cc>(1)  and B<pc>(1).  The "
9690 "SYNOPSIS sections of the following manual pages indicate which include files "
9691 "are to be used, what the compiler declaration for the function looks like "
9692 "and which external variables are of interest."
9693 msgstr ""
9694
9695 #.  Not on Linux: .BR fropen ,
9696 #.  Not on Linux: .BR fwopen ,
9697 #. type: Plain text
9698 #: build/C/man3/stdio.3:183
9699 msgid ""
9700 "The following are defined as macros; these names may not be reused without "
9701 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
9702 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
9703 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
9704 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
9705 "B<stderr>, B<stdin>, B<stdout>.  Function versions of the macro functions "
9706 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
9707 "and B<putchar> exist and will be used if the macros definitions are "
9708 "explicitly removed."
9709 msgstr ""
9710
9711 #. type: SS
9712 #: build/C/man3/stdio.3:183
9713 #, no-wrap
9714 msgid "List of functions"
9715 msgstr ""
9716
9717 #. type: tbl table
9718 #: build/C/man3/stdio.3:188
9719 #, no-wrap
9720 msgid "Function\tDescription\n"
9721 msgstr ""
9722
9723 #. type: tbl table
9724 #: build/C/man3/stdio.3:189
9725 #, no-wrap
9726 msgid "_\n"
9727 msgstr ""
9728
9729 #. type: tbl table
9730 #: build/C/man3/stdio.3:190
9731 #, no-wrap
9732 msgid "clearerr\tcheck and reset stream status\n"
9733 msgstr ""
9734
9735 #. type: tbl table
9736 #: build/C/man3/stdio.3:191
9737 #, no-wrap
9738 msgid "fclose\tclose a stream\n"
9739 msgstr ""
9740
9741 #. type: tbl table
9742 #: build/C/man3/stdio.3:192
9743 #, no-wrap
9744 msgid "fdopen\tstream open functions\n"
9745 msgstr ""
9746
9747 #. type: tbl table
9748 #: build/C/man3/stdio.3:193
9749 #, no-wrap
9750 msgid "feof\tcheck and reset stream status\n"
9751 msgstr ""
9752
9753 #. type: tbl table
9754 #: build/C/man3/stdio.3:194
9755 #, no-wrap
9756 msgid "ferror\tcheck and reset stream status\n"
9757 msgstr ""
9758
9759 #. type: tbl table
9760 #: build/C/man3/stdio.3:195
9761 #, no-wrap
9762 msgid "fflush\tflush a stream\n"
9763 msgstr ""
9764
9765 #. type: tbl table
9766 #: build/C/man3/stdio.3:196
9767 #, no-wrap
9768 msgid "fgetc\tget next character or word from input stream\n"
9769 msgstr ""
9770
9771 #. type: tbl table
9772 #: build/C/man3/stdio.3:197
9773 #, no-wrap
9774 msgid "fgetpos\treposition a stream\n"
9775 msgstr ""
9776
9777 #. type: tbl table
9778 #: build/C/man3/stdio.3:198
9779 #, no-wrap
9780 msgid "fgets\tget a line from a stream\n"
9781 msgstr ""
9782
9783 #. type: tbl table
9784 #: build/C/man3/stdio.3:199
9785 #, no-wrap
9786 msgid "fileno\treturn the integer descriptor of the argument stream\n"
9787 msgstr ""
9788
9789 #. type: tbl table
9790 #: build/C/man3/stdio.3:200
9791 #, no-wrap
9792 msgid "fopen\tstream open functions\n"
9793 msgstr ""
9794
9795 #. type: tbl table
9796 #: build/C/man3/stdio.3:201
9797 #, no-wrap
9798 msgid "fprintf\tformatted output conversion\n"
9799 msgstr ""
9800
9801 #. type: tbl table
9802 #: build/C/man3/stdio.3:202
9803 #, no-wrap
9804 msgid "fpurge\tflush a stream\n"
9805 msgstr ""
9806
9807 #. type: tbl table
9808 #: build/C/man3/stdio.3:203
9809 #, no-wrap
9810 msgid "fputc\toutput a character or word to a stream\n"
9811 msgstr ""
9812
9813 #. type: tbl table
9814 #: build/C/man3/stdio.3:204
9815 #, no-wrap
9816 msgid "fputs\toutput a line to a stream\n"
9817 msgstr ""
9818
9819 #. type: tbl table
9820 #: build/C/man3/stdio.3:205
9821 #, no-wrap
9822 msgid "fread\tbinary stream input/output\n"
9823 msgstr ""
9824
9825 #. type: tbl table
9826 #: build/C/man3/stdio.3:206
9827 #, no-wrap
9828 msgid "freopen\tstream open functions\n"
9829 msgstr ""
9830
9831 #. type: tbl table
9832 #: build/C/man3/stdio.3:207
9833 #, no-wrap
9834 msgid "fscanf\tinput format conversion\n"
9835 msgstr ""
9836
9837 #. type: tbl table
9838 #: build/C/man3/stdio.3:208
9839 #, no-wrap
9840 msgid "fseek\treposition a stream\n"
9841 msgstr ""
9842
9843 #. type: tbl table
9844 #: build/C/man3/stdio.3:209
9845 #, no-wrap
9846 msgid "fsetpos\treposition a stream\n"
9847 msgstr ""
9848
9849 #. type: tbl table
9850 #: build/C/man3/stdio.3:210
9851 #, no-wrap
9852 msgid "ftell\treposition a stream\n"
9853 msgstr ""
9854
9855 #. type: tbl table
9856 #: build/C/man3/stdio.3:211
9857 #, no-wrap
9858 msgid "fwrite\tbinary stream input/output\n"
9859 msgstr ""
9860
9861 #. type: tbl table
9862 #: build/C/man3/stdio.3:212
9863 #, no-wrap
9864 msgid "getc\tget next character or word from input stream\n"
9865 msgstr ""
9866
9867 #. type: tbl table
9868 #: build/C/man3/stdio.3:213
9869 #, no-wrap
9870 msgid "getchar\tget next character or word from input stream\n"
9871 msgstr ""
9872
9873 #. type: tbl table
9874 #: build/C/man3/stdio.3:214
9875 #, no-wrap
9876 msgid "gets\tget a line from a stream\n"
9877 msgstr ""
9878
9879 #. type: tbl table
9880 #: build/C/man3/stdio.3:215
9881 #, no-wrap
9882 msgid "getw\tget next character or word from input stream\n"
9883 msgstr ""
9884
9885 #. type: tbl table
9886 #: build/C/man3/stdio.3:216
9887 #, no-wrap
9888 msgid "mktemp\tmake temporary filename (unique)\n"
9889 msgstr ""
9890
9891 #. type: tbl table
9892 #: build/C/man3/stdio.3:217
9893 #, no-wrap
9894 msgid "perror\tsystem error messages\n"
9895 msgstr ""
9896
9897 #. type: tbl table
9898 #: build/C/man3/stdio.3:218
9899 #, no-wrap
9900 msgid "printf\tformatted output conversion\n"
9901 msgstr ""
9902
9903 #. type: tbl table
9904 #: build/C/man3/stdio.3:219
9905 #, no-wrap
9906 msgid "putc\toutput a character or word to a stream\n"
9907 msgstr ""
9908
9909 #. type: tbl table
9910 #: build/C/man3/stdio.3:220
9911 #, no-wrap
9912 msgid "putchar\toutput a character or word to a stream\n"
9913 msgstr ""
9914
9915 #. type: tbl table
9916 #: build/C/man3/stdio.3:221
9917 #, no-wrap
9918 msgid "puts\toutput a line to a stream\n"
9919 msgstr ""
9920
9921 #. type: tbl table
9922 #: build/C/man3/stdio.3:222
9923 #, no-wrap
9924 msgid "putw\toutput a character or word to a stream\n"
9925 msgstr ""
9926
9927 #. type: tbl table
9928 #: build/C/man3/stdio.3:223
9929 #, no-wrap
9930 msgid "remove\tremove directory entry\n"
9931 msgstr ""
9932
9933 #. type: tbl table
9934 #: build/C/man3/stdio.3:224
9935 #, no-wrap
9936 msgid "rewind\treposition a stream\n"
9937 msgstr ""
9938
9939 #. type: tbl table
9940 #: build/C/man3/stdio.3:225
9941 #, no-wrap
9942 msgid "scanf\tinput format conversion\n"
9943 msgstr ""
9944
9945 #. type: tbl table
9946 #: build/C/man3/stdio.3:226
9947 #, no-wrap
9948 msgid "setbuf\tstream buffering operations\n"
9949 msgstr ""
9950
9951 #. type: tbl table
9952 #: build/C/man3/stdio.3:227
9953 #, no-wrap
9954 msgid "setbuffer\tstream buffering operations\n"
9955 msgstr ""
9956
9957 #. type: tbl table
9958 #: build/C/man3/stdio.3:228
9959 #, no-wrap
9960 msgid "setlinebuf\tstream buffering operations\n"
9961 msgstr ""
9962
9963 #. type: tbl table
9964 #: build/C/man3/stdio.3:229
9965 #, no-wrap
9966 msgid "setvbuf\tstream buffering operations\n"
9967 msgstr ""
9968
9969 #. type: tbl table
9970 #: build/C/man3/stdio.3:230
9971 #, no-wrap
9972 msgid "sprintf\tformatted output conversion\n"
9973 msgstr ""
9974
9975 #. type: tbl table
9976 #: build/C/man3/stdio.3:231
9977 #, no-wrap
9978 msgid "sscanf\tinput format conversion\n"
9979 msgstr ""
9980
9981 #. type: tbl table
9982 #: build/C/man3/stdio.3:232
9983 #, no-wrap
9984 msgid "strerror\tsystem error messages\n"
9985 msgstr ""
9986
9987 #. type: tbl table
9988 #: build/C/man3/stdio.3:233
9989 #, no-wrap
9990 msgid "sys_errlist\tsystem error messages\n"
9991 msgstr ""
9992
9993 #. type: tbl table
9994 #: build/C/man3/stdio.3:234
9995 #, no-wrap
9996 msgid "sys_nerr\tsystem error messages\n"
9997 msgstr ""
9998
9999 #. type: tbl table
10000 #: build/C/man3/stdio.3:235
10001 #, no-wrap
10002 msgid "tempnam\ttemporary file routines\n"
10003 msgstr ""
10004
10005 #. type: tbl table
10006 #: build/C/man3/stdio.3:236
10007 #, no-wrap
10008 msgid "tmpfile\ttemporary file routines\n"
10009 msgstr ""
10010
10011 #. type: tbl table
10012 #: build/C/man3/stdio.3:237
10013 #, no-wrap
10014 msgid "tmpnam\ttemporary file routines\n"
10015 msgstr ""
10016
10017 #. type: tbl table
10018 #: build/C/man3/stdio.3:238
10019 #, no-wrap
10020 msgid "ungetc\tun-get character from input stream\n"
10021 msgstr ""
10022
10023 #. type: tbl table
10024 #: build/C/man3/stdio.3:239
10025 #, no-wrap
10026 msgid "vfprintf\tformatted output conversion\n"
10027 msgstr ""
10028
10029 #. type: tbl table
10030 #: build/C/man3/stdio.3:240
10031 #, no-wrap
10032 msgid "vfscanf\tinput format conversion\n"
10033 msgstr ""
10034
10035 #. type: tbl table
10036 #: build/C/man3/stdio.3:241
10037 #, no-wrap
10038 msgid "vprintf\tformatted output conversion\n"
10039 msgstr ""
10040
10041 #. type: tbl table
10042 #: build/C/man3/stdio.3:242
10043 #, no-wrap
10044 msgid "vscanf\tinput format conversion\n"
10045 msgstr ""
10046
10047 #. type: tbl table
10048 #: build/C/man3/stdio.3:243
10049 #, no-wrap
10050 msgid "vsprintf\tformatted output conversion\n"
10051 msgstr ""
10052
10053 #. type: tbl table
10054 #: build/C/man3/stdio.3:244
10055 #, no-wrap
10056 msgid "vsscanf\tinput format conversion\n"
10057 msgstr ""
10058
10059 #. type: Plain text
10060 #: build/C/man3/stdio.3:250
10061 msgid "The I<stdio> library conforms to C89."
10062 msgstr ""
10063
10064 #. type: Plain text
10065 #: build/C/man3/stdio.3:257
10066 msgid ""
10067 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
10068 "B<unlocked_stdio>(3)"
10069 msgstr ""
10070
10071 #. type: TH
10072 #: build/C/man3/stdio_ext.3:25
10073 #, no-wrap
10074 msgid "STDIO_EXT"
10075 msgstr ""
10076
10077 #. type: TH
10078 #: build/C/man3/stdio_ext.3:25
10079 #, no-wrap
10080 msgid "2001-12-16"
10081 msgstr ""
10082
10083 #. type: Plain text
10084 #: build/C/man3/stdio_ext.3:30
10085 msgid ""
10086 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
10087 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
10088 "structure"
10089 msgstr ""
10090
10091 #. type: Plain text
10092 #: build/C/man3/stdio_ext.3:34
10093 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
10094 msgstr ""
10095
10096 #. type: Plain text
10097 #: build/C/man3/stdio_ext.3:36
10098 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
10099 msgstr ""
10100
10101 #. type: Plain text
10102 #: build/C/man3/stdio_ext.3:38
10103 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
10104 msgstr ""
10105
10106 #. type: Plain text
10107 #: build/C/man3/stdio_ext.3:40
10108 msgid "B<int __flbf(FILE *>I<stream>B<);>"
10109 msgstr ""
10110
10111 #. type: Plain text
10112 #: build/C/man3/stdio_ext.3:42
10113 msgid "B<int __freadable(FILE *>I<stream>B<);>"
10114 msgstr ""
10115
10116 #. type: Plain text
10117 #: build/C/man3/stdio_ext.3:44
10118 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
10119 msgstr ""
10120
10121 #. type: Plain text
10122 #: build/C/man3/stdio_ext.3:46
10123 msgid "B<int __freading(FILE *>I<stream>B<);>"
10124 msgstr ""
10125
10126 #. type: Plain text
10127 #: build/C/man3/stdio_ext.3:48
10128 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
10129 msgstr ""
10130
10131 #. type: Plain text
10132 #: build/C/man3/stdio_ext.3:50
10133 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
10134 msgstr ""
10135
10136 #. type: Plain text
10137 #: build/C/man3/stdio_ext.3:52
10138 msgid "B<void _flushlbf(void);>"
10139 msgstr ""
10140
10141 #. type: Plain text
10142 #: build/C/man3/stdio_ext.3:54
10143 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
10144 msgstr ""
10145
10146 #. type: Plain text
10147 #: build/C/man3/stdio_ext.3:59
10148 msgid ""
10149 "Solaris introduced routines to allow portable access to the internals of the "
10150 "I<FILE> structure, and glibc also implemented these."
10151 msgstr ""
10152
10153 #. type: Plain text
10154 #: build/C/man3/stdio_ext.3:64
10155 msgid ""
10156 "The B<__fbufsize>()  function returns the size of the buffer currently used "
10157 "by the given stream."
10158 msgstr ""
10159
10160 #. type: Plain text
10161 #: build/C/man3/stdio_ext.3:71
10162 msgid ""
10163 "The B<__fpending>()  function returns the number of bytes in the output "
10164 "buffer.  For wide-oriented streams the unit is wide characters.  This "
10165 "function is undefined on buffers in reading mode, or opened read-only."
10166 msgstr ""
10167
10168 #. type: Plain text
10169 #: build/C/man3/stdio_ext.3:76
10170 msgid ""
10171 "The B<__flbf>()  function returns a nonzero value if the stream is "
10172 "line-buffered, and zero otherwise."
10173 msgstr ""
10174
10175 #. type: Plain text
10176 #: build/C/man3/stdio_ext.3:81
10177 msgid ""
10178 "The B<__freadable>()  function returns a nonzero value if the stream allows "
10179 "reading, and zero otherwise."
10180 msgstr ""
10181
10182 #. type: Plain text
10183 #: build/C/man3/stdio_ext.3:86
10184 msgid ""
10185 "The B<__fwritable>()  function returns a nonzero value if the stream allows "
10186 "writing, and zero otherwise."
10187 msgstr ""
10188
10189 #. type: Plain text
10190 #: build/C/man3/stdio_ext.3:92
10191 msgid ""
10192 "The B<__freading>()  function returns a nonzero value if the stream is "
10193 "read-only, or if the last operation on the stream was a read operation, and "
10194 "zero otherwise."
10195 msgstr ""
10196
10197 #. type: Plain text
10198 #: build/C/man3/stdio_ext.3:98
10199 msgid ""
10200 "The B<__fwriting>()  function returns a nonzero value if the stream is "
10201 "write-only (or append-only), or if the last operation on the stream was a "
10202 "write operation, and zero otherwise."
10203 msgstr ""
10204
10205 #. type: Plain text
10206 #: build/C/man3/stdio_ext.3:106
10207 msgid ""
10208 "The B<__fsetlocking>()  function can be used to select the desired type of "
10209 "locking on the stream.  It returns the current type.  The I<type> argument "
10210 "can take the following three values:"
10211 msgstr ""
10212
10213 #. type: TP
10214 #: build/C/man3/stdio_ext.3:106
10215 #, no-wrap
10216 msgid "B<FSETLOCKING_INTERNAL>"
10217 msgstr ""
10218
10219 #. type: Plain text
10220 #: build/C/man3/stdio_ext.3:111
10221 msgid ""
10222 "Perform implicit locking around every operation on the given stream (except "
10223 "for the *_unlocked ones).  This is the default."
10224 msgstr ""
10225
10226 #. type: TP
10227 #: build/C/man3/stdio_ext.3:111
10228 #, no-wrap
10229 msgid "B<FSETLOCKING_BYCALLER>"
10230 msgstr ""
10231
10232 #. type: Plain text
10233 #: build/C/man3/stdio_ext.3:118
10234 msgid ""
10235 "The caller will take care of the locking (possibly using B<flockfile>(3)  in "
10236 "case there is more than one thread), and the stdio routines will not do "
10237 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
10238 msgstr ""
10239
10240 #. type: TP
10241 #: build/C/man3/stdio_ext.3:118
10242 #, no-wrap
10243 msgid "B<FSETLOCKING_QUERY>"
10244 msgstr ""
10245
10246 #. type: Plain text
10247 #: build/C/man3/stdio_ext.3:122
10248 msgid "Don't change the type of locking.  (Only return it.)"
10249 msgstr ""
10250
10251 #. type: Plain text
10252 #: build/C/man3/stdio_ext.3:128
10253 msgid ""
10254 "The B<_flushlbf>()  function flushes all line-buffered streams.  (Presumably "
10255 "so that output to a terminal is forced out, say before reading keyboard "
10256 "input.)"
10257 msgstr ""
10258
10259 #. type: Plain text
10260 #: build/C/man3/stdio_ext.3:132
10261 msgid "The B<__fpurge>()  function discards the contents of the stream's buffer."
10262 msgstr ""
10263
10264 #. type: Plain text
10265 #: build/C/man3/stdio_ext.3:135
10266 msgid "B<flockfile>(3), B<fpurge>(3)"
10267 msgstr ""
10268
10269 #. type: TH
10270 #: build/C/man2/symlink.2:32 build/C/man7/symlink.7:36
10271 #, no-wrap
10272 msgid "SYMLINK"
10273 msgstr ""
10274
10275 #. type: Plain text
10276 #: build/C/man2/symlink.2:35
10277 msgid "symlink - make a new name for a file"
10278 msgstr ""
10279
10280 #. type: Plain text
10281 #: build/C/man2/symlink.2:39
10282 msgid "B<int symlink(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
10283 msgstr ""
10284
10285 #. type: Plain text
10286 #: build/C/man2/symlink.2:47
10287 msgid "B<symlink>():"
10288 msgstr ""
10289
10290 #. type: Plain text
10291 #: build/C/man2/symlink.2:58
10292 msgid ""
10293 "B<symlink>()  creates a symbolic link named I<newpath> which contains the "
10294 "string I<oldpath>."
10295 msgstr ""
10296
10297 #. type: Plain text
10298 #: build/C/man2/symlink.2:62
10299 msgid ""
10300 "Symbolic links are interpreted at run time as if the contents of the link "
10301 "had been substituted into the path being followed to find a file or "
10302 "directory."
10303 msgstr ""
10304
10305 #. type: Plain text
10306 #: build/C/man2/symlink.2:67
10307 msgid ""
10308 "Symbolic links may contain I<..> path components, which (if used at the "
10309 "start of the link) refer to the parent directories of that in which the link "
10310 "resides."
10311 msgstr ""
10312
10313 #. type: Plain text
10314 #: build/C/man2/symlink.2:71
10315 msgid ""
10316 "A symbolic link (also known as a soft link) may point to an existing file or "
10317 "to a nonexistent one; the latter case is known as a dangling link."
10318 msgstr ""
10319
10320 #. type: Plain text
10321 #: build/C/man2/symlink.2:78
10322 msgid ""
10323 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
10324 "when following the link, but is checked when removal or renaming of the link "
10325 "is requested and the link is in a directory with the sticky bit (B<S_ISVTX>)  "
10326 "set."
10327 msgstr ""
10328
10329 #. type: Plain text
10330 #: build/C/man2/symlink.2:99
10331 msgid ""
10332 "Write access to the directory containing I<newpath> is denied, or one of the "
10333 "directories in the path prefix of I<newpath> did not allow search "
10334 "permission.  (See also B<path_resolution>(7).)"
10335 msgstr ""
10336
10337 #. type: Plain text
10338 #: build/C/man2/symlink.2:104
10339 msgid ""
10340 "The user's quota of resources on the file system has been exhausted.  The "
10341 "resources could be inodes or disk blocks, depending on the file system "
10342 "implementation."
10343 msgstr ""
10344
10345 #. type: Plain text
10346 #: build/C/man2/symlink.2:118
10347 msgid "Too many symbolic links were encountered in resolving I<newpath>."
10348 msgstr ""
10349
10350 #. type: Plain text
10351 #: build/C/man2/symlink.2:128
10352 msgid ""
10353 "A directory component in I<newpath> does not exist or is a dangling symbolic "
10354 "link, or I<oldpath> is the empty string."
10355 msgstr ""
10356
10357 #. type: Plain text
10358 #: build/C/man2/symlink.2:140
10359 msgid "A component used as a directory in I<newpath> is not, in fact, a directory."
10360 msgstr ""
10361
10362 #. type: Plain text
10363 #: build/C/man2/symlink.2:145
10364 msgid ""
10365 "The file system containing I<newpath> does not support the creation of "
10366 "symbolic links."
10367 msgstr ""
10368
10369 #. type: Plain text
10370 #: build/C/man2/symlink.2:149
10371 msgid "I<newpath> is on a read-only file system."
10372 msgstr ""
10373
10374 #. type: Plain text
10375 #: build/C/man2/symlink.2:159
10376 msgid "No checking of I<oldpath> is done."
10377 msgstr ""
10378
10379 #. type: Plain text
10380 #: build/C/man2/symlink.2:164
10381 msgid ""
10382 "Deleting the name referred to by a symlink will actually delete the file "
10383 "(unless it also has other hard links).  If this behavior is not desired, use "
10384 "B<link>(2)."
10385 msgstr ""
10386
10387 #. type: Plain text
10388 #: build/C/man2/symlink.2:176
10389 msgid ""
10390 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
10391 "B<rename>(2), B<symlinkat>(2), B<unlink>(2), B<path_resolution>(7), "
10392 "B<symlink>(7)"
10393 msgstr ""
10394
10395 #. type: TH
10396 #: build/C/man7/symlink.7:36
10397 #, no-wrap
10398 msgid "2008-06-18"
10399 msgstr ""
10400
10401 #. type: Plain text
10402 #: build/C/man7/symlink.7:39
10403 msgid "symlink - symbolic link handling"
10404 msgstr ""
10405
10406 #. type: SH
10407 #: build/C/man7/symlink.7:39
10408 #, no-wrap
10409 msgid "SYMBOLIC LINK HANDLING"
10410 msgstr ""
10411
10412 #. type: Plain text
10413 #: build/C/man7/symlink.7:43
10414 msgid ""
10415 "Symbolic links are files that act as pointers to other files.  To understand "
10416 "their behavior, you must first understand how hard links work."
10417 msgstr ""
10418
10419 #. type: Plain text
10420 #: build/C/man7/symlink.7:59
10421 msgid ""
10422 "A hard link to a file is indistinguishable from the original file because it "
10423 "is a reference to the object underlying the original filename.  (To be "
10424 "precise: each of the hard links to a file is a reference to the same "
10425 "I<i-node number>, where an i-node number is an index into the i-node table, "
10426 "which contains metadata about all files on a file system.  See B<stat>(2).)  "
10427 "Changes to a file are independent of the name used to reference the file.  "
10428 "Hard links may not refer to directories (to prevent the possibility of loops "
10429 "within the file system tree, which would confuse many programs)  and may not "
10430 "refer to files on different file systems (because i-node numbers are not "
10431 "unique across file systems)."
10432 msgstr ""
10433
10434 #. type: Plain text
10435 #: build/C/man7/symlink.7:66
10436 msgid ""
10437 "A symbolic link is a special type of file whose contents are a string that "
10438 "is the pathname another file, the file to which the link refers.  In other "
10439 "words, a symbolic link is a pointer to another name, and not to an "
10440 "underlying object.  For this reason, symbolic links may refer to directories "
10441 "and may cross file system boundaries."
10442 msgstr ""
10443
10444 #. type: Plain text
10445 #: build/C/man7/symlink.7:72
10446 msgid ""
10447 "There is no requirement that the pathname referred to by a symbolic link "
10448 "should exist.  A symbolic link that refers to a pathname that does not exist "
10449 "is said to be a I<dangling link>."
10450 msgstr ""
10451
10452 #. type: Plain text
10453 #: build/C/man7/symlink.7:84
10454 msgid ""
10455 "Because a symbolic link and its referenced object coexist in the file system "
10456 "name space, confusion can arise in distinguishing between the link itself "
10457 "and the referenced object.  On historical systems, commands and system calls "
10458 "adopted their own link-following conventions in a somewhat ad-hoc fashion.  "
10459 "Rules for a more uniform approach, as they are implemented on Linux and "
10460 "other systems, are outlined here.  It is important that site-local "
10461 "applications also conform to these rules, so that the user interface can be "
10462 "as consistent as possible."
10463 msgstr ""
10464
10465 #. type: SS
10466 #: build/C/man7/symlink.7:84
10467 #, no-wrap
10468 msgid "Symbolic link ownership, permissions, and timestamps"
10469 msgstr ""
10470
10471 #. type: Plain text
10472 #: build/C/man7/symlink.7:92
10473 msgid ""
10474 "The owner and group of an existing symbolic link can be changed using "
10475 "B<lchown>(2).  The only time that the ownership of a symbolic link matters "
10476 "is when the link is being removed or renamed in a directory that has the "
10477 "sticky bit set (see B<stat>(2))."
10478 msgstr ""
10479
10480 #. type: Plain text
10481 #: build/C/man7/symlink.7:98
10482 msgid ""
10483 "The last access and last modification timestamps of a symbolic link can be "
10484 "changed using B<utimensat>(2)  or B<lutimes>(3)."
10485 msgstr ""
10486
10487 #.  Linux does not currently implement an lchmod(2).
10488 #
10489 #.  The
10490 #.  4.4BSD
10491 #.  system differs from historical
10492 #.  4BSD
10493 #.  systems in that the system call
10494 #.  .BR chown (2)
10495 #.  has been changed to follow symbolic links.
10496 #.  The
10497 #.  .BR lchown (2)
10498 #.  system call was added later when the limitations of the new
10499 #.  .BR chown (2)
10500 #.  became apparent.
10501 #. type: Plain text
10502 #: build/C/man7/symlink.7:117
10503 msgid ""
10504 "On Linux, the permissions of a symbolic link are not used in any operations; "
10505 "the permissions are always 0777 (read, write, and execute for all user "
10506 "categories), and can't be changed."
10507 msgstr ""
10508
10509 #. type: SS
10510 #: build/C/man7/symlink.7:117
10511 #, no-wrap
10512 msgid "Handling of symbolic links by system calls and commands"
10513 msgstr ""
10514
10515 #. type: Plain text
10516 #: build/C/man7/symlink.7:132
10517 msgid ""
10518 "Symbolic links are handled either by operating on the link itself, or by "
10519 "operating on the object referred to by the link.  In the latter case, an "
10520 "application or system call is said to I<follow> the link.  Symbolic links "
10521 "may refer to other symbolic links, in which case the links are dereferenced "
10522 "until an object that is not a symbolic link is found, a symbolic link that "
10523 "refers to a file which does not exist is found, or a loop is detected.  "
10524 "(Loop detection is done by placing an upper limit on the number of links "
10525 "that may be followed, and an error results if this limit is exceeded.)"
10526 msgstr ""
10527
10528 #. type: Plain text
10529 #: build/C/man7/symlink.7:135
10530 msgid ""
10531 "There are three separate areas that need to be discussed.  They are as "
10532 "follows:"
10533 msgstr ""
10534
10535 #. type: IP
10536 #: build/C/man7/symlink.7:135
10537 #, no-wrap
10538 msgid "1."
10539 msgstr ""
10540
10541 #. type: Plain text
10542 #: build/C/man7/symlink.7:137
10543 msgid "Symbolic links used as filename arguments for system calls."
10544 msgstr ""
10545
10546 #. type: IP
10547 #: build/C/man7/symlink.7:137
10548 #, no-wrap
10549 msgid "2."
10550 msgstr ""
10551
10552 #. type: Plain text
10553 #: build/C/man7/symlink.7:140
10554 msgid ""
10555 "Symbolic links specified as command-line arguments to utilities that are not "
10556 "traversing a file tree."
10557 msgstr ""
10558
10559 #. type: IP
10560 #: build/C/man7/symlink.7:140
10561 #, no-wrap
10562 msgid "3."
10563 msgstr ""
10564
10565 #. type: Plain text
10566 #: build/C/man7/symlink.7:144
10567 msgid ""
10568 "Symbolic links encountered by utilities that are traversing a file tree "
10569 "(either specified on the command line or encountered as part of the file "
10570 "hierarchy walk)."
10571 msgstr ""
10572
10573 #. type: SS
10574 #: build/C/man7/symlink.7:144
10575 #, no-wrap
10576 msgid "System calls"
10577 msgstr ""
10578
10579 #. type: Plain text
10580 #: build/C/man7/symlink.7:147
10581 msgid ""
10582 "The first area is symbolic links used as filename arguments for system "
10583 "calls."
10584 msgstr ""
10585
10586 #. type: Plain text
10587 #: build/C/man7/symlink.7:157
10588 msgid ""
10589 "Except as noted below, all system calls follow symbolic links.  For example, "
10590 "if there were a symbolic link I<slink> which pointed to a file named "
10591 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
10592 "descriptor referring to the file I<afile>."
10593 msgstr ""
10594
10595 #.  Maybe one day: .BR fchownat (2)
10596 #. type: Plain text
10597 #: build/C/man7/symlink.7:207
10598 msgid ""
10599 "Various system calls do not follow links, and operate on the symbolic link "
10600 "itself.  They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
10601 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
10602 "B<rename>(2), B<rmdir>(2), and B<unlink>(2).  Certain other system calls "
10603 "optionally follow symbolic links.  They are: B<faccessat>(2), "
10604 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), and "
10605 "B<utimensat>(2); see their manual pages for details.  Because B<remove>(3)  "
10606 "is an alias for B<unlink>(2), that library function also does not follow "
10607 "symbolic links.  When B<rmdir>(2)  is applied to a symbolic link, it fails "
10608 "with the error B<ENOTDIR>.  The B<link>(2)  warrants special discussion.  "
10609 "POSIX.1-2001 specifies that B<link>(2)  should dereference I<oldpath> if it "
10610 "is a symbolic link.  However, Linux does not do this.  (By default Solaris "
10611 "is the same, but the POSIX.1-2001 specified behavior can be obtained with "
10612 "suitable compiler options.)  The upcoming POSIX.1 revision changes the "
10613 "specification to allow either behavior in an implementation."
10614 msgstr ""
10615
10616 #. type: SS
10617 #: build/C/man7/symlink.7:207
10618 #, no-wrap
10619 msgid "Commands not traversing a file tree"
10620 msgstr ""
10621
10622 #. type: Plain text
10623 #: build/C/man7/symlink.7:210
10624 msgid ""
10625 "The second area is symbolic links, specified as command-line filename "
10626 "arguments, to commands which are not traversing a file tree."
10627 msgstr ""
10628
10629 #. type: Plain text
10630 #: build/C/man7/symlink.7:221
10631 msgid ""
10632 "Except as noted below, commands follow symbolic links named as command-line "
10633 "arguments.  For example, if there were a symbolic link I<slink> which "
10634 "pointed to a file named I<afile>, the command I<cat slink> would display the "
10635 "contents of the file I<afile>."
10636 msgstr ""
10637
10638 #. type: Plain text
10639 #: build/C/man7/symlink.7:229
10640 msgid ""
10641 "It is important to realize that this rule includes commands which may "
10642 "optionally traverse file trees, e.g., the command I<chown file> is included "
10643 "in this rule, while the command I<chown\\ -R file>, which performs a tree "
10644 "traversal, is not.  (The latter is described in the third area, below.)"
10645 msgstr ""
10646
10647 #. type: Plain text
10648 #: build/C/man7/symlink.7:247
10649 msgid ""
10650 "If it is explicitly intended that the command operate on the symbolic link "
10651 "instead of following the symbolic link, e.g., it is desired that I<chown "
10652 "slink> change the ownership of the file that I<slink> is, whether it is a "
10653 "symbolic link or not, the I<-h> option should be used.  In the above "
10654 "example, I<chown root slink> would change the ownership of the file referred "
10655 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
10656 "I<slink> itself."
10657 msgstr ""
10658
10659 #. type: Plain text
10660 #: build/C/man7/symlink.7:249
10661 msgid "There are some exceptions to this rule:"
10662 msgstr ""
10663
10664 #. type: Plain text
10665 #: build/C/man7/symlink.7:259
10666 msgid ""
10667 "The B<mv>(1)  and B<rm>(1)  commands do not follow symbolic links named as "
10668 "arguments, but respectively attempt to rename and delete them.  (Note, if "
10669 "the symbolic link references a file via a relative path, moving it to "
10670 "another directory may very well cause it to stop working, since the path may "
10671 "no longer be correct.)"
10672 msgstr ""
10673
10674 #. type: Plain text
10675 #: build/C/man7/symlink.7:289
10676 msgid ""
10677 "The B<ls>(1)  command is also an exception to this rule.  For compatibility "
10678 "with historic systems (when B<ls>(1)  is not doing a tree walk, i.e., the "
10679 "I<-R> option is not specified), the B<ls>(1)  command follows symbolic links "
10680 "named as arguments if the I<-H> or I<-L> option is specified, or if the "
10681 "I<-F>, I<-d>, or I<-l> options are not specified.  (The B<ls>(1)  command is "
10682 "the only command where the I<-H> and I<-L> options affect its behavior even "
10683 "though it is not doing a walk of a file tree.)"
10684 msgstr ""
10685
10686 #
10687 #. The 4.4BSD system differs from historical 4BSD systems in that the
10688 #. .BR chown (1)
10689 #. and
10690 #. .BR chgrp (1)
10691 #. commands follow symbolic links specified on the command line.
10692 #. type: Plain text
10693 #: build/C/man7/symlink.7:307
10694 msgid ""
10695 "The B<file>(1)  command is also an exception to this rule.  The B<file>(1)  "
10696 "command does not follow symbolic links named as argument by default.  The "
10697 "B<file>(1)  command does follow symbolic links named as argument if the "
10698 "I<-L> option is specified."
10699 msgstr ""
10700
10701 #. type: SS
10702 #: build/C/man7/symlink.7:307
10703 #, no-wrap
10704 msgid "Commands traversing a file tree"
10705 msgstr ""
10706
10707 #. type: Plain text
10708 #: build/C/man7/symlink.7:320
10709 msgid ""
10710 "The following commands either optionally or always traverse file trees: "
10711 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
10712 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
10713 msgstr ""
10714
10715 #. type: Plain text
10716 #: build/C/man7/symlink.7:324
10717 msgid ""
10718 "It is important to realize that the following rules apply equally to "
10719 "symbolic links encountered during the file tree traversal and symbolic links "
10720 "listed as command-line arguments."
10721 msgstr ""
10722
10723 #. type: Plain text
10724 #: build/C/man7/symlink.7:329
10725 msgid ""
10726 "The I<first rule> applies to symbolic links that reference files other than "
10727 "directories.  Operations that apply to symbolic links are performed on the "
10728 "links themselves, but otherwise the links are ignored."
10729 msgstr ""
10730
10731 #. type: Plain text
10732 #: build/C/man7/symlink.7:341
10733 msgid ""
10734 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
10735 "symbolic links encountered in the tree traversal of I<directory>, because "
10736 "symbolic links may be removed.  In no case will B<rm>(1)  affect the file "
10737 "referred to by I<slink>."
10738 msgstr ""
10739
10740 #. type: Plain text
10741 #: build/C/man7/symlink.7:346
10742 msgid ""
10743 "The I<second rule> applies to symbolic links that refer to directories.  "
10744 "Symbolic links that refer to directories are never followed by default.  "
10745 "This is often referred to as a \"physical\" walk, as opposed to a "
10746 "\"logical\" walk (where symbolic links the refer to directories are "
10747 "followed)."
10748 msgstr ""
10749
10750 #. type: Plain text
10751 #: build/C/man7/symlink.7:349
10752 msgid ""
10753 "Certain conventions are (should be) followed as consistently as possible by "
10754 "commands that perform file tree walks:"
10755 msgstr ""
10756
10757 #. type: Plain text
10758 #: build/C/man7/symlink.7:362
10759 msgid ""
10760 "A command can be made to follow any symbolic links named on the command "
10761 "line, regardless of the type of file they reference, by specifying the I<-H> "
10762 "(for \"half-logical\") flag.  This flag is intended to make the command-line "
10763 "name space look like the logical name space.  (Note, for commands that do "
10764 "not always do file tree traversals, the I<-H> flag will be ignored if the "
10765 "I<-R> flag is not also specified.)"
10766 msgstr ""
10767
10768 #. type: Plain text
10769 #: build/C/man7/symlink.7:378
10770 msgid ""
10771 "For example, the command I<chown\\ -HR user slink> will traverse the file "
10772 "hierarchy rooted in the file pointed to by I<slink>.  Note, the I<-H> is not "
10773 "the same as the previously discussed I<-h> flag.  The I<-H> flag causes "
10774 "symbolic links specified on the command line to be dereferenced for the "
10775 "purposes of both the action to be performed and the tree walk, and it is as "
10776 "if the user had specified the name of the file to which the symbolic link "
10777 "pointed."
10778 msgstr ""
10779
10780 #. type: Plain text
10781 #: build/C/man7/symlink.7:392
10782 msgid ""
10783 "A command can be made to follow any symbolic links named on the command "
10784 "line, as well as any symbolic links encountered during the traversal, "
10785 "regardless of the type of file they reference, by specifying the I<-L> (for "
10786 "\"logical\") flag.  This flag is intended to make the entire name space look "
10787 "like the logical name space.  (Note, for commands that do not always do file "
10788 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
10789 "also specified.)"
10790 msgstr ""
10791
10792 #. type: Plain text
10793 #: build/C/man7/symlink.7:407
10794 msgid ""
10795 "For example, the command I<chown\\ -LR user slink> will change the owner of "
10796 "the file referred to by I<slink>.  If I<slink> refers to a directory, "
10797 "B<chown> will traverse the file hierarchy rooted in the directory that it "
10798 "references.  In addition, if any symbolic links are encountered in any file "
10799 "tree that B<chown> traverses, they will be treated in the same fashion as "
10800 "I<slink>."
10801 msgstr ""
10802
10803 #. type: Plain text
10804 #: build/C/man7/symlink.7:414
10805 msgid ""
10806 "A command can be made to provide the default behavior by specifying the "
10807 "I<-P> (for \"physical\") flag.  This flag is intended to make the entire "
10808 "name space look like the physical name space."
10809 msgstr ""
10810
10811 #. type: Plain text
10812 #: build/C/man7/symlink.7:432
10813 msgid ""
10814 "For commands that do not by default do file tree traversals, the I<-H>, "
10815 "I<-L>, and I<-P> flags are ignored if the I<-R> flag is not also specified.  "
10816 "In addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
10817 "once; the last one specified determines the command's behavior.  This is "
10818 "intended to permit you to alias commands to behave one way or the other, and "
10819 "then override that behavior on the command line."
10820 msgstr ""
10821
10822 #. type: Plain text
10823 #: build/C/man7/symlink.7:438
10824 msgid "The B<ls>(1)  and B<rm>(1)  commands have exceptions to these rules:"
10825 msgstr ""
10826
10827 #. type: Plain text
10828 #: build/C/man7/symlink.7:451
10829 msgid ""
10830 "The B<rm>(1)  command operates on the symbolic link, and not the file it "
10831 "references, and therefore never follows a symbolic link.  The B<rm>(1)  "
10832 "command does not support the I<-H>, I<-L>, or I<-P> options."
10833 msgstr ""
10834
10835 #. type: Plain text
10836 #: build/C/man7/symlink.7:471
10837 msgid ""
10838 "To maintain compatibility with historic systems, the B<ls>(1)  command acts "
10839 "a little differently.  If you do not specify the I<-F>, I<-d> or I<-l> "
10840 "options, B<ls>(1)  will follow symbolic links specified on the command "
10841 "line.  If the I<-L> flag is specified, B<ls>(1)  follows all symbolic links, "
10842 "regardless of their type, whether specified on the command line or "
10843 "encountered in the tree walk."
10844 msgstr ""
10845
10846 #. type: Plain text
10847 #: build/C/man7/symlink.7:489
10848 msgid ""
10849 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
10850 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
10851 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
10852 "B<path_resolution>(7)"
10853 msgstr ""
10854
10855 #. type: TH
10856 #: build/C/man3/tempnam.3:25
10857 #, no-wrap
10858 msgid "TEMPNAM"
10859 msgstr ""
10860
10861 #. type: TH
10862 #: build/C/man3/tempnam.3:25
10863 #, no-wrap
10864 msgid "2008-08-06"
10865 msgstr ""
10866
10867 #. type: Plain text
10868 #: build/C/man3/tempnam.3:28
10869 msgid "tempnam - create a name for a temporary file"
10870 msgstr ""
10871
10872 #. type: Plain text
10873 #: build/C/man3/tempnam.3:33
10874 #, no-wrap
10875 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
10876 msgstr ""
10877
10878 #. type: Plain text
10879 #: build/C/man3/tempnam.3:42
10880 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
10881 msgstr ""
10882
10883 #. type: Plain text
10884 #: build/C/man3/tempnam.3:56
10885 msgid ""
10886 "The B<tempnam>()  function returns a pointer to a string that is a valid "
10887 "filename, and such that a file with this name did not exist when "
10888 "B<tempnam>()  checked.  The filename suffix of the pathname generated will "
10889 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
10890 "bytes.  The directory prefix part of the pathname generated is required to "
10891 "be \"appropriate\" (often that at least implies writable)."
10892 msgstr ""
10893
10894 #. type: Plain text
10895 #: build/C/man3/tempnam.3:59
10896 msgid "Attempts to find an appropriate directory go through the following steps:"
10897 msgstr ""
10898
10899 #. type: TP
10900 #: build/C/man3/tempnam.3:59
10901 #, no-wrap
10902 msgid "a)"
10903 msgstr ""
10904
10905 #. type: Plain text
10906 #: build/C/man3/tempnam.3:65
10907 msgid ""
10908 "In case the environment variable B<TMPDIR> exists and contains the name of "
10909 "an appropriate directory, that is used."
10910 msgstr ""
10911
10912 #. type: TP
10913 #: build/C/man3/tempnam.3:65
10914 #, no-wrap
10915 msgid "b)"
10916 msgstr ""
10917
10918 #. type: Plain text
10919 #: build/C/man3/tempnam.3:70
10920 msgid "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
10921 msgstr ""
10922
10923 #. type: TP
10924 #: build/C/man3/tempnam.3:70
10925 #, no-wrap
10926 msgid "c)"
10927 msgstr ""
10928
10929 #. type: Plain text
10930 #: build/C/man3/tempnam.3:77
10931 msgid ""
10932 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>)  is used when "
10933 "appropriate."
10934 msgstr ""
10935
10936 #. type: TP
10937 #: build/C/man3/tempnam.3:77
10938 #, no-wrap
10939 msgid "d)"
10940 msgstr ""
10941
10942 #. type: Plain text
10943 #: build/C/man3/tempnam.3:80
10944 msgid "Finally an implementation-defined directory may be used."
10945 msgstr ""
10946
10947 #. type: Plain text
10948 #: build/C/man3/tempnam.3:87
10949 msgid ""
10950 "The string returned by B<tempnam>()  is allocated using B<malloc>(3)  and "
10951 "hence should be freed by B<free>(3)."
10952 msgstr ""
10953
10954 #. type: Plain text
10955 #: build/C/man3/tempnam.3:92
10956 msgid ""
10957 "The B<tempnam>()  function returns a pointer to a unique temporary filename, "
10958 "or NULL if a unique name cannot be generated."
10959 msgstr ""
10960
10961 #. type: Plain text
10962 #: build/C/man3/tempnam.3:96
10963 msgid "Allocation of storage failed."
10964 msgstr ""
10965
10966 #. type: Plain text
10967 #: build/C/man3/tempnam.3:101
10968 msgid "SVr4, 4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<tempnam>()  as obsolete."
10969 msgstr ""
10970
10971 #. type: Plain text
10972 #: build/C/man3/tempnam.3:120
10973 msgid ""
10974 "Although B<tempnam>()  generates names that are difficult to guess, it is "
10975 "nevertheless possible that between the time that B<tempnam>()  returns a "
10976 "pathname, and the time that the program opens it, another program might "
10977 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10978 "This can lead to security holes.  To avoid such possibilities, use the "
10979 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
10980 "B<mkstemp>(3)  or B<tmpfile>(3)."
10981 msgstr ""
10982
10983 #. type: Plain text
10984 #: build/C/man3/tempnam.3:128
10985 msgid ""
10986 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
10987 "program is not set-user-ID.  On SVr4, the directory used under B<d)> is "
10988 "I</tmp> (and this is what glibc does)."
10989 msgstr ""
10990
10991 #. type: Plain text
10992 #: build/C/man3/tempnam.3:133
10993 msgid ""
10994 "Because it dynamically allocates memory used to return the pathname, "
10995 "B<tempnam>()  is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
10996 msgstr ""
10997
10998 #. type: Plain text
10999 #: build/C/man3/tempnam.3:146
11000 msgid ""
11001 "The B<tempnam>()  function generates a different string each time it is "
11002 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>)  times.  If it is "
11003 "called more than B<TMP_MAX> times, the behavior is implementation defined."
11004 msgstr ""
11005
11006 #. type: Plain text
11007 #: build/C/man3/tempnam.3:150
11008 msgid "B<tempnam>()  uses at most the first five bytes from I<pfx>."
11009 msgstr ""
11010
11011 #. type: Plain text
11012 #: build/C/man3/tempnam.3:156
11013 msgid ""
11014 "The glibc implementation of B<tempnam>()  will fail with the error B<EEXIST> "
11015 "upon failure to find a unique name."
11016 msgstr ""
11017
11018 #. type: Plain text
11019 #: build/C/man3/tempnam.3:159
11020 msgid ""
11021 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
11022 "accessibility of a directory is determined."
11023 msgstr ""
11024
11025 #. type: Plain text
11026 #: build/C/man3/tempnam.3:166 build/C/man3/tmpnam.3:153
11027 msgid "Never use this function.  Use B<mkstemp>(3)  or B<tmpfile>(3)  instead."
11028 msgstr ""
11029
11030 #. type: Plain text
11031 #: build/C/man3/tempnam.3:171
11032 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
11033 msgstr ""
11034
11035 #. type: TH
11036 #: build/C/man3/tmpfile.3:31
11037 #, no-wrap
11038 msgid "TMPFILE"
11039 msgstr ""
11040
11041 #. type: Plain text
11042 #: build/C/man3/tmpfile.3:34
11043 msgid "tmpfile - create a temporary file"
11044 msgstr ""
11045
11046 #. type: Plain text
11047 #: build/C/man3/tmpfile.3:39
11048 #, no-wrap
11049 msgid "B<FILE *tmpfile(void);>\n"
11050 msgstr ""
11051
11052 #. type: Plain text
11053 #: build/C/man3/tmpfile.3:47
11054 msgid ""
11055 "The B<tmpfile>()  function opens a unique temporary file in binary "
11056 "read/write (w+b) mode.  The file will be automatically deleted when it is "
11057 "closed or the program terminates."
11058 msgstr ""
11059
11060 #. type: Plain text
11061 #: build/C/man3/tmpfile.3:54
11062 msgid ""
11063 "The B<tmpfile>()  function returns a stream descriptor, or NULL if a unique "
11064 "filename cannot be generated or the unique file cannot be opened.  In the "
11065 "latter case, I<errno> is set to indicate the error."
11066 msgstr ""
11067
11068 #. type: Plain text
11069 #: build/C/man3/tmpfile.3:58
11070 msgid "Search permission denied for directory in file's path prefix."
11071 msgstr ""
11072
11073 #. type: Plain text
11074 #: build/C/man3/tmpfile.3:61
11075 msgid "Unable to generate a unique filename."
11076 msgstr ""
11077
11078 #. type: Plain text
11079 #: build/C/man3/tmpfile.3:64
11080 msgid "The call was interrupted by a signal."
11081 msgstr ""
11082
11083 #. type: Plain text
11084 #: build/C/man3/tmpfile.3:67
11085 msgid "Too many file descriptors in use by the process."
11086 msgstr ""
11087
11088 #. type: Plain text
11089 #: build/C/man3/tmpfile.3:70
11090 msgid "Too many files open in the system."
11091 msgstr ""
11092
11093 #. type: Plain text
11094 #: build/C/man3/tmpfile.3:73
11095 msgid "There was no room in the directory to add the new filename."
11096 msgstr ""
11097
11098 #. type: Plain text
11099 #: build/C/man3/tmpfile.3:76
11100 msgid "Read-only file system."
11101 msgstr ""
11102
11103 #. type: Plain text
11104 #: build/C/man3/tmpfile.3:78
11105 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
11106 msgstr ""
11107
11108 #. type: Plain text
11109 #: build/C/man3/tmpfile.3:82
11110 msgid ""
11111 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
11112 "stream cannot be opened."
11113 msgstr ""
11114
11115 #. type: Plain text
11116 #: build/C/man3/tmpfile.3:88
11117 msgid ""
11118 "The standard does not specify the directory that B<tmpfile>()  will use.  "
11119 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
11120 "and if that fails the directory I</tmp>."
11121 msgstr ""
11122
11123 #. type: Plain text
11124 #: build/C/man3/tmpfile.3:94
11125 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
11126 msgstr ""
11127
11128 #. type: TH
11129 #: build/C/man3/tmpnam.3:27
11130 #, no-wrap
11131 msgid "TMPNAM"
11132 msgstr ""
11133
11134 #. type: TH
11135 #: build/C/man3/tmpnam.3:27
11136 #, no-wrap
11137 msgid "2010-09-10"
11138 msgstr ""
11139
11140 #. type: Plain text
11141 #: build/C/man3/tmpnam.3:30
11142 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
11143 msgstr ""
11144
11145 #. type: Plain text
11146 #: build/C/man3/tmpnam.3:35
11147 #, no-wrap
11148 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
11149 msgstr ""
11150
11151 #. type: Plain text
11152 #: build/C/man3/tmpnam.3:58
11153 msgid ""
11154 "The B<tmpnam>()  function returns a pointer to a string that is a valid "
11155 "filename, and such that a file with this name did not exist at some point in "
11156 "time, so that naive programmers may think it a suitable name for a temporary "
11157 "file.  If the argument I<s> is NULL this name is generated in an internal "
11158 "static buffer and may be overwritten by the next call to B<tmpnam>().  If "
11159 "I<s> is not NULL, the name is copied to the character array (of length at "
11160 "least I<L_tmpnam>)  pointed to by I<s> and the value I<s> is returned in "
11161 "case of success."
11162 msgstr ""
11163
11164 #. type: Plain text
11165 #: build/C/man3/tmpnam.3:70
11166 msgid ""
11167 "The pathname that is created, has a directory prefix I<P_tmpdir>.  (Both "
11168 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
11169 "the B<TMP_MAX> mentioned below.)"
11170 msgstr ""
11171
11172 #. type: Plain text
11173 #: build/C/man3/tmpnam.3:75
11174 msgid ""
11175 "The B<tmpnam>()  function returns a pointer to a unique temporary filename, "
11176 "or NULL if a unique name cannot be generated."
11177 msgstr ""
11178
11179 #. type: Plain text
11180 #: build/C/man3/tmpnam.3:77
11181 msgid "No errors are defined."
11182 msgstr ""
11183
11184 #. type: Plain text
11185 #: build/C/man3/tmpnam.3:82
11186 msgid ""
11187 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001.  POSIX.1-2008 marks B<tmpnam>()  as "
11188 "obsolete."
11189 msgstr ""
11190
11191 #. type: Plain text
11192 #: build/C/man3/tmpnam.3:93
11193 msgid ""
11194 "The B<tmpnam>()  function generates a different string each time it is "
11195 "called, up to B<TMP_MAX> times.  If it is called more than B<TMP_MAX> times, "
11196 "the behavior is implementation defined."
11197 msgstr ""
11198
11199 #. type: Plain text
11200 #: build/C/man3/tmpnam.3:112
11201 msgid ""
11202 "Although B<tmpnam>()  generates names that are difficult to guess, it is "
11203 "nevertheless possible that between the time that B<tmpnam>()  returns a "
11204 "pathname, and the time that the program opens it, another program might "
11205 "create that pathname using B<open>(2), or create it as a symbolic link.  "
11206 "This can lead to security holes.  To avoid such possibilities, use the "
11207 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
11208 "B<mkstemp>(3)  or B<tmpfile>(3)."
11209 msgstr ""
11210
11211 #. type: Plain text
11212 #: build/C/man3/tmpnam.3:120
11213 msgid ""
11214 "Portable applications that use threads cannot call B<tmpnam>()  with a NULL "
11215 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
11216 "defined."
11217 msgstr ""
11218
11219 #. type: Plain text
11220 #: build/C/man3/tmpnam.3:124
11221 msgid "A POSIX draft proposed to use a function B<tmpnam_r>()  defined by"
11222 msgstr ""
11223
11224 #. type: Plain text
11225 #: build/C/man3/tmpnam.3:132
11226 #, no-wrap
11227 msgid ""
11228 "char *\n"
11229 "tmpnam_r(char *s)\n"
11230 "{\n"
11231 "    return s ? tmpnam(s) : NULL;\n"
11232 "}\n"
11233 msgstr ""
11234
11235 #. type: Plain text
11236 #: build/C/man3/tmpnam.3:146
11237 msgid ""
11238 "apparently as a warning not to use NULL.  A few systems implement it.  To "
11239 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
11240 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
11241 msgstr ""
11242
11243 #. type: Plain text
11244 #: build/C/man3/tmpnam.3:158
11245 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
11246 msgstr ""
11247
11248 #. type: TH
11249 #: build/C/man2/unlink.2:32
11250 #, no-wrap
11251 msgid "UNLINK"
11252 msgstr ""
11253
11254 #. type: TH
11255 #: build/C/man2/unlink.2:32
11256 #, no-wrap
11257 msgid "2011-09-15"
11258 msgstr ""
11259
11260 #. type: Plain text
11261 #: build/C/man2/unlink.2:35
11262 msgid "unlink - delete a name and possibly the file it refers to"
11263 msgstr ""
11264
11265 #. type: Plain text
11266 #: build/C/man2/unlink.2:39
11267 msgid "B<int unlink(const char *>I<pathname>B<);>"
11268 msgstr ""
11269
11270 #. type: Plain text
11271 #: build/C/man2/unlink.2:45
11272 msgid ""
11273 "B<unlink>()  deletes a name from the file system.  If that name was the last "
11274 "link to a file and no processes have the file open the file is deleted and "
11275 "the space it was using is made available for reuse."
11276 msgstr ""
11277
11278 #. type: Plain text
11279 #: build/C/man2/unlink.2:49
11280 msgid ""
11281 "If the name was the last link to a file but any processes still have the "
11282 "file open the file will remain in existence until the last file descriptor "
11283 "referring to it is closed."
11284 msgstr ""
11285
11286 #. type: Plain text
11287 #: build/C/man2/unlink.2:51
11288 msgid "If the name referred to a symbolic link the link is removed."
11289 msgstr ""
11290
11291 #. type: Plain text
11292 #: build/C/man2/unlink.2:55
11293 msgid ""
11294 "If the name referred to a socket, fifo or device the name for it is removed "
11295 "but processes which have the object open may continue to use it."
11296 msgstr ""
11297
11298 #. type: Plain text
11299 #: build/C/man2/unlink.2:71
11300 msgid ""
11301 "Write access to the directory containing I<pathname> is not allowed for the "
11302 "process's effective UID, or one of the directories in I<pathname> did not "
11303 "allow search permission.  (See also B<path_resolution>(7).)"
11304 msgstr ""
11305
11306 #. type: Plain text
11307 #: build/C/man2/unlink.2:80
11308 msgid ""
11309 "The file I<pathname> cannot be unlinked because it is being used by the "
11310 "system or another process; for example, it is a mount point or the NFS "
11311 "client software created it to represent an active but otherwise nameless "
11312 "inode (\"NFS silly renamed\")."
11313 msgstr ""
11314
11315 #. type: Plain text
11316 #: build/C/man2/unlink.2:92
11317 msgid ""
11318 "I<pathname> refers to a directory.  (This is the non-POSIX value returned by "
11319 "Linux since 2.1.132.)"
11320 msgstr ""
11321
11322 #. type: Plain text
11323 #: build/C/man2/unlink.2:96
11324 msgid "Too many symbolic links were encountered in translating I<pathname>."
11325 msgstr ""
11326
11327 #. type: Plain text
11328 #: build/C/man2/unlink.2:106
11329 msgid ""
11330 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
11331 "I<pathname> is empty."
11332 msgstr ""
11333
11334 #. type: Plain text
11335 #: build/C/man2/unlink.2:114
11336 msgid "A component used as a directory in I<pathname> is not, in fact, a directory."
11337 msgstr ""
11338
11339 #. type: Plain text
11340 #: build/C/man2/unlink.2:123
11341 msgid ""
11342 "The system does not allow unlinking of directories, or unlinking of "
11343 "directories requires privileges that the calling process doesn't have.  "
11344 "(This is the POSIX prescribed error return; as noted above, Linux returns "
11345 "B<EISDIR> for this case.)"
11346 msgstr ""
11347
11348 #. type: TP
11349 #: build/C/man2/unlink.2:123
11350 #, no-wrap
11351 msgid "B<EPERM> (Linux only)"
11352 msgstr ""
11353
11354 #. type: Plain text
11355 #: build/C/man2/unlink.2:126
11356 msgid "The file system does not allow unlinking of files."
11357 msgstr ""
11358
11359 #. type: Plain text
11360 #: build/C/man2/unlink.2:137
11361 msgid ""
11362 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
11363 "and the process's effective UID is neither the UID of the file to be deleted "
11364 "nor that of the directory containing it, and the process is not privileged "
11365 "(Linux: does not have the B<CAP_FOWNER> capability)."
11366 msgstr ""
11367
11368 #. type: Plain text
11369 #: build/C/man2/unlink.2:141
11370 msgid "I<pathname> refers to a file on a read-only file system."
11371 msgstr ""
11372
11373 #. type: Plain text
11374 #: build/C/man2/unlink.2:161
11375 msgid ""
11376 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
11377 "B<rmdir>(2), B<unlinkat>(2), B<mkfifo>(3), B<remove>(3), "
11378 "B<path_resolution>(7), B<symlink>(7)"
11379 msgstr ""
11380
11381 #. type: TH
11382 #: build/C/man3/unlocked_stdio.3:25
11383 #, no-wrap
11384 msgid "UNLOCKED_STDIO"
11385 msgstr ""
11386
11387 #. type: Plain text
11388 #: build/C/man3/unlocked_stdio.3:29
11389 msgid ""
11390 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
11391 "nonlocking stdio functions"
11392 msgstr ""
11393
11394 #. type: Plain text
11395 #: build/C/man3/unlocked_stdio.3:37
11396 #, no-wrap
11397 msgid ""
11398 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
11399 "B<int getchar_unlocked(void);>\n"
11400 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11401 "B<int putchar_unlocked(int >I<c>B<);>\n"
11402 msgstr ""
11403
11404 #. type: Plain text
11405 #: build/C/man3/unlocked_stdio.3:49
11406 #, no-wrap
11407 msgid ""
11408 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
11409 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
11410 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
11411 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
11412 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
11413 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
11414 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11415 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t "
11416 ">I<n>B<,>\n"
11417 "B<                      FILE *>I<stream>B<);>\n"
11418 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
11419 ">I<n>B<,>\n"
11420 "B<                      FILE *>I<stream>B<);>\n"
11421 msgstr ""
11422
11423 #. type: Plain text
11424 #: build/C/man3/unlocked_stdio.3:52
11425 #, no-wrap
11426 msgid ""
11427 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
11428 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11429 msgstr ""
11430
11431 #. type: Plain text
11432 #: build/C/man3/unlocked_stdio.3:63
11433 #, no-wrap
11434 msgid ""
11435 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
11436 "B<wint_t getwchar_unlocked(void);>\n"
11437 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
11438 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11439 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11440 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
11441 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE "
11442 "*>I<stream>B<);>\n"
11443 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
11444 msgstr ""
11445
11446 #. type: Plain text
11447 #: build/C/man3/unlocked_stdio.3:75
11448 msgid ""
11449 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
11450 "B<putchar_unlocked>():"
11451 msgstr ""
11452
11453 #. type: Plain text
11454 #: build/C/man3/unlocked_stdio.3:78
11455 msgid ""
11456 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
11457 "_BSD_SOURCE || _SVID_SOURCE"
11458 msgstr ""
11459
11460 #. type: Plain text
11461 #: build/C/man3/unlocked_stdio.3:89
11462 msgid ""
11463 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
11464 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
11465 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
11466 msgstr ""
11467
11468 #. type: Plain text
11469 #: build/C/man3/unlocked_stdio.3:91
11470 msgid "_BSD_SOURCE || _SVID_SOURCE"
11471 msgstr ""
11472
11473 #. type: Plain text
11474 #: build/C/man3/unlocked_stdio.3:102
11475 msgid ""
11476 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
11477 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
11478 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
11479 msgstr ""
11480
11481 #. type: Plain text
11482 #: build/C/man3/unlocked_stdio.3:113
11483 msgid ""
11484 "Each of these functions has the same behavior as its counterpart without the "
11485 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
11486 "locks themselves, and do not test for the presence of locks set by others) "
11487 "and hence are thread-unsafe.  See B<flockfile>(3)."
11488 msgstr ""
11489
11490 #. type: Plain text
11491 #: build/C/man3/unlocked_stdio.3:120
11492 msgid ""
11493 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
11494 "B<putc_unlocked>(), B<putchar_unlocked>()  are in POSIX.1-2001."
11495 msgstr ""
11496
11497 #.  E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
11498 #.  moved to a compatibility library.
11499 #.  Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
11500 #.  feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
11501 #.  fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
11502 #.  fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
11503 #.  ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
11504 #.  getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
11505 #.  putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
11506 #.  putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
11507 #.  ungetc_unlocked, ungetwc_unlocked.
11508 #. type: Plain text
11509 #: build/C/man3/unlocked_stdio.3:136
11510 msgid ""
11511 "The nonstandard B<*_unlocked>()  variants occur on a few UNIX systems, and "
11512 "are available in recent glibc.  They should probably not be used."
11513 msgstr ""
11514
11515 #. type: Plain text
11516 #: build/C/man3/unlocked_stdio.3:139
11517 msgid "B<flockfile>(3), B<stdio>(3)"
11518 msgstr ""
11519
11520 #. type: TH
11521 #: build/C/man3/wprintf.3:16
11522 #, no-wrap
11523 msgid "WPRINTF"
11524 msgstr ""
11525
11526 #. type: TH
11527 #: build/C/man3/wprintf.3:16
11528 #, no-wrap
11529 msgid "2011-09-17"
11530 msgstr ""
11531
11532 #. type: Plain text
11533 #: build/C/man3/wprintf.3:20
11534 msgid ""
11535 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted "
11536 "wide-character output conversion"
11537 msgstr ""
11538
11539 #. type: Plain text
11540 #: build/C/man3/wprintf.3:24
11541 #, no-wrap
11542 msgid ""
11543 "B<#include E<lt>stdio.hE<gt>>\n"
11544 "B<#include E<lt>wchar.hE<gt>>\n"
11545 msgstr ""
11546
11547 #. type: Plain text
11548 #: build/C/man3/wprintf.3:29
11549 #, no-wrap
11550 msgid ""
11551 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
11552 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
11553 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11554 "B<             const wchar_t *>I<format>B<, ...);>\n"
11555 msgstr ""
11556
11557 #. type: Plain text
11558 #: build/C/man3/wprintf.3:34
11559 #, no-wrap
11560 msgid ""
11561 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11562 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list "
11563 ">I<args>B<);>\n"
11564 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11565 "B<              const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11566 msgstr ""
11567
11568 #.  .BR wprintf (),
11569 #.  .BR fwprintf (),
11570 #.  .BR swprintf (),
11571 #.  .BR vwprintf (),
11572 #.  .BR vfwprintf (),
11573 #.  .BR vswprintf ():
11574 #. type: Plain text
11575 #: build/C/man3/wprintf.3:51
11576 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
11577 msgstr ""
11578
11579 #. type: Plain text
11580 #: build/C/man3/wprintf.3:53
11581 msgid "_ISOC95_SOURCE /* Since glibc 2.12 */ ||"
11582 msgstr ""
11583
11584 #. type: Plain text
11585 #: build/C/man3/wprintf.3:55
11586 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
11587 msgstr ""
11588
11589 #. type: Plain text
11590 #: build/C/man3/wprintf.3:58
11591 msgid "or I<cc\\ -std=c99>"
11592 msgstr ""
11593
11594 #. type: Plain text
11595 #: build/C/man3/wprintf.3:69
11596 msgid ""
11597 "The B<wprintf>()  family of functions is the wide-character equivalent of "
11598 "the B<printf>(3)  family of functions.  It performs formatted output of wide "
11599 "characters."
11600 msgstr ""
11601
11602 #. type: Plain text
11603 #: build/C/man3/wprintf.3:79
11604 msgid ""
11605 "The B<wprintf>()  and B<vwprintf>()  functions perform wide-character output "
11606 "to I<stdout>.  I<stdout> must not be byte oriented; see B<fwide>(3)  for "
11607 "more information."
11608 msgstr ""
11609
11610 #. type: Plain text
11611 #: build/C/man3/wprintf.3:89
11612 msgid ""
11613 "The B<fwprintf>()  and B<vfwprintf>()  functions perform wide-character "
11614 "output to I<stream>.  I<stream> must not be byte oriented; see B<fwide>(3)  "
11615 "for more information."
11616 msgstr ""
11617
11618 #. type: Plain text
11619 #: build/C/man3/wprintf.3:100
11620 msgid ""
11621 "The B<swprintf>()  and B<vswprintf>()  functions perform wide-character "
11622 "output to an array of wide characters.  The programmer must ensure that "
11623 "there is room for at least I<maxlen> wide characters at I<wcs>."
11624 msgstr ""
11625
11626 #. type: Plain text
11627 #: build/C/man3/wprintf.3:111
11628 msgid ""
11629 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
11630 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3)  functions except for the "
11631 "following differences:"
11632 msgstr ""
11633
11634 #. type: TP
11635 #: build/C/man3/wprintf.3:111 build/C/man3/wprintf.3:114 build/C/man3/wprintf.3:117
11636 #, no-wrap
11637 msgid "B<\\(bu>"
11638 msgstr ""
11639
11640 #. type: Plain text
11641 #: build/C/man3/wprintf.3:114
11642 msgid "The I<format> string is a wide-character string."
11643 msgstr ""
11644
11645 #. type: Plain text
11646 #: build/C/man3/wprintf.3:117
11647 msgid "The output consists of wide characters, not bytes."
11648 msgstr ""
11649
11650 #. type: Plain text
11651 #: build/C/man3/wprintf.3:132
11652 msgid ""
11653 "B<swprintf>()  and B<vswprintf>()  take a I<maxlen> argument, B<sprintf>(3)  "
11654 "and B<vsprintf>(3)  do not.  (B<snprintf>(3)  and B<vsnprintf>(3)  take a "
11655 "I<maxlen> argument, but these functions do not return -1 upon buffer "
11656 "overflow on Linux.)"
11657 msgstr ""
11658
11659 #. type: Plain text
11660 #: build/C/man3/wprintf.3:134
11661 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
11662 msgstr ""
11663
11664 #. type: Plain text
11665 #: build/C/man3/wprintf.3:148
11666 msgid ""
11667 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
11668 "character by a call to the B<btowc>(3)  function, and the resulting wide "
11669 "character is written.  If an B<l> modifier is present, the I<wint_t> (wide "
11670 "character) argument is written."
11671 msgstr ""
11672
11673 #. type: Plain text
11674 #: build/C/man3/wprintf.3:187
11675 msgid ""
11676 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
11677 "to be a pointer to an array of character type (pointer to a string) "
11678 "containing a multibyte character sequence beginning in the initial shift "
11679 "state.  Characters from the array are converted to wide characters (each by "
11680 "a call to the B<mbrtowc>(3)  function with a conversion state starting in "
11681 "the initial state before the first byte).  The resulting wide characters are "
11682 "written up to (but not including) the terminating null wide character.  If a "
11683 "precision is specified, no more wide characters than the number specified "
11684 "are written.  Note that the precision determines the number of I<wide "
11685 "characters> written, not the number of I<bytes> or I<screen positions>.  The "
11686 "array must contain a terminating null byte, unless a precision is given and "
11687 "it is so small that the number of converted wide characters reaches it "
11688 "before the end of the array is reached.  If an B<l> modifier is present: The "
11689 "I<const\\ wchar_t\\ *> argument is expected to be a pointer to an array of "
11690 "wide characters.  Wide characters from the array are written up to (but not "
11691 "including) a terminating null wide character.  If a precision is specified, "
11692 "no more than the number specified are written.  The array must contain a "
11693 "terminating null wide character, unless a precision is given and it is "
11694 "smaller than or equal to the number of wide characters in the array."
11695 msgstr ""
11696
11697 #. type: Plain text
11698 #: build/C/man3/wprintf.3:195
11699 msgid ""
11700 "The functions return the number of wide characters written, excluding the "
11701 "terminating null wide character in case of the functions B<swprintf>()  and "
11702 "B<vswprintf>().  They return -1 when an error occurs."
11703 msgstr ""
11704
11705 #. type: Plain text
11706 #: build/C/man3/wprintf.3:197
11707 msgid "C99."
11708 msgstr ""
11709
11710 #. type: Plain text
11711 #: build/C/man3/wprintf.3:205
11712 msgid ""
11713 "The behavior of B<wprintf>()  et al. depends on the B<LC_CTYPE> category of "
11714 "the current locale."
11715 msgstr ""
11716
11717 #. type: Plain text
11718 #: build/C/man3/wprintf.3:231
11719 msgid ""
11720 "If the I<format> string contains non-ASCII wide characters, the program will "
11721 "only work correctly if the B<LC_CTYPE> category of the current locale at run "
11722 "time is the same as the B<LC_CTYPE> category of the current locale at "
11723 "compile time.  This is because the I<wchar_t> representation is platform- "
11724 "and locale-dependent.  (The glibc represents wide characters using their "
11725 "Unicode (ISO-10646) code point, but other platforms don't do this.  Also, "
11726 "the use of C99 universal character names of the form \\eunnnn does not solve "
11727 "this problem.)  Therefore, in internationalized programs, the I<format> "
11728 "string should consist of ASCII wide characters only, or should be "
11729 "constructed at run time in an internationalized way (e.g., using "
11730 "B<gettext>(3)  or B<iconv>(3), followed by B<mbstowcs>(3))."
11731 msgstr ""
11732
11733 #.  .BR wscanf (3)
11734 #. type: Plain text
11735 #: build/C/man3/wprintf.3:238
11736 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
11737 msgstr ""
11738
11739 #. type: TH
11740 #: build/C/man2/write.2:39
11741 #, no-wrap
11742 msgid "WRITE"
11743 msgstr ""
11744
11745 #. type: Plain text
11746 #: build/C/man2/write.2:42
11747 msgid "write - write to a file descriptor"
11748 msgstr ""
11749
11750 #. type: Plain text
11751 #: build/C/man2/write.2:46
11752 msgid "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
11753 msgstr ""
11754
11755 #. type: Plain text
11756 #: build/C/man2/write.2:54
11757 msgid ""
11758 "B<write>()  writes up to I<count> bytes from the buffer pointed I<buf> to "
11759 "the file referred to by the file descriptor I<fd>."
11760 msgstr ""
11761
11762 #. type: Plain text
11763 #: build/C/man2/write.2:68
11764 msgid ""
11765 "The number of bytes written may be less than I<count> if, for example, there "
11766 "is insufficient space on the underlying physical medium, or the "
11767 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
11768 "call was interrupted by a signal handler after having written less than "
11769 "I<count> bytes.  (See also B<pipe>(7).)"
11770 msgstr ""
11771
11772 #. type: Plain text
11773 #: build/C/man2/write.2:82
11774 msgid ""
11775 "For a seekable file (i.e., one to which B<lseek>(2)  may be applied, for "
11776 "example, a regular file)  writing takes place at the current file offset, "
11777 "and the file offset is incremented by the number of bytes actually written.  "
11778 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
11779 "to the end of the file before writing.  The adjustment of the file offset "
11780 "and the write operation are performed as an atomic step."
11781 msgstr ""
11782
11783 #. type: Plain text
11784 #: build/C/man2/write.2:89
11785 msgid ""
11786 "POSIX requires that a B<read>(2)  which can be proved to occur after a "
11787 "B<write>()  has returned returns the new data.  Note that not all file "
11788 "systems are POSIX conforming."
11789 msgstr ""
11790
11791 #. type: Plain text
11792 #: build/C/man2/write.2:94
11793 msgid ""
11794 "On success, the number of bytes written is returned (zero indicates nothing "
11795 "was written).  On error, -1 is returned, and I<errno> is set appropriately."
11796 msgstr ""
11797
11798 #. type: Plain text
11799 #: build/C/man2/write.2:107
11800 msgid ""
11801 "If I<count> is zero and I<fd> refers to a regular file, then B<write>()  may "
11802 "return a failure status if one of the errors below is detected.  If no "
11803 "errors are detected, 0 will be returned without causing any other effect.  "
11804 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
11805 "the results are not specified."
11806 msgstr ""
11807
11808 #. type: Plain text
11809 #: build/C/man2/write.2:115
11810 msgid ""
11811 "The file descriptor I<fd> refers to a file other than a socket and has been "
11812 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
11813 msgstr ""
11814
11815 #.  Actually EAGAIN on Linux
11816 #. type: Plain text
11817 #: build/C/man2/write.2:126
11818 msgid ""
11819 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11820 "(B<O_NONBLOCK>), and the write would block.  POSIX.1-2001 allows either "
11821 "error to be returned for this case, and does not require these constants to "
11822 "have the same value, so a portable application should check for both "
11823 "possibilities."
11824 msgstr ""
11825
11826 #. type: Plain text
11827 #: build/C/man2/write.2:130
11828 msgid "I<fd> is not a valid file descriptor or is not open for writing."
11829 msgstr ""
11830
11831 #. type: TP
11832 #: build/C/man2/write.2:130
11833 #, no-wrap
11834 msgid "B<EDESTADDRREQ>"
11835 msgstr ""
11836
11837 #. type: Plain text
11838 #: build/C/man2/write.2:135
11839 msgid ""
11840 "I<fd> refers to a datagram socket for which a peer address has not been set "
11841 "using B<connect>(2)."
11842 msgstr ""
11843
11844 #. type: Plain text
11845 #: build/C/man2/write.2:141
11846 msgid ""
11847 "The user's quota of disk blocks on the file system containing the file "
11848 "referred to by I<fd> has been exhausted."
11849 msgstr ""
11850
11851 #. type: Plain text
11852 #: build/C/man2/write.2:150
11853 msgid ""
11854 "An attempt was made to write a file that exceeds the implementation-defined "
11855 "maximum file size or the process's file size limit, or to write at a "
11856 "position past the maximum allowed offset."
11857 msgstr ""
11858
11859 #. type: Plain text
11860 #: build/C/man2/write.2:154
11861 msgid ""
11862 "The call was interrupted by a signal before any data was written; see "
11863 "B<signal>(7)."
11864 msgstr ""
11865
11866 #. type: Plain text
11867 #: build/C/man2/write.2:165
11868 msgid ""
11869 "I<fd> is attached to an object which is unsuitable for writing; or the file "
11870 "was opened with the B<O_DIRECT> flag, and either the address specified in "
11871 "I<buf>, the value specified in I<count>, or the current file offset is not "
11872 "suitably aligned."
11873 msgstr ""
11874
11875 #. type: Plain text
11876 #: build/C/man2/write.2:168
11877 msgid "A low-level I/O error occurred while modifying the inode."
11878 msgstr ""
11879
11880 #. type: Plain text
11881 #: build/C/man2/write.2:173
11882 msgid ""
11883 "The device containing the file referred to by I<fd> has no room for the "
11884 "data."
11885 msgstr ""
11886
11887 #. type: TP
11888 #: build/C/man2/write.2:173
11889 #, no-wrap
11890 msgid "B<EPIPE>"
11891 msgstr ""
11892
11893 #. type: Plain text
11894 #: build/C/man2/write.2:182
11895 msgid ""
11896 "I<fd> is connected to a pipe or socket whose reading end is closed.  When "
11897 "this happens the writing process will also receive a B<SIGPIPE> signal.  "
11898 "(Thus, the write return value is seen only if the program catches, blocks or "
11899 "ignores this signal.)"
11900 msgstr ""
11901
11902 #. type: Plain text
11903 #: build/C/man2/write.2:185
11904 msgid "Other errors may occur, depending on the object connected to I<fd>."
11905 msgstr ""
11906
11907 #. type: Plain text
11908 #: build/C/man2/write.2:194
11909 msgid ""
11910 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
11911 "just before any data is written."
11912 msgstr ""
11913
11914 #. type: Plain text
11915 #: build/C/man2/write.2:203
11916 msgid ""
11917 "A successful return from B<write>()  does not make any guarantee that data "
11918 "has been committed to disk.  In fact, on some buggy implementations, it does "
11919 "not even guarantee that space has successfully been reserved for the data.  "
11920 "The only way to be sure is to call B<fsync>(2)  after you are done writing "
11921 "all your data."
11922 msgstr ""
11923
11924 #. type: Plain text
11925 #: build/C/man2/write.2:211
11926 msgid ""
11927 "If a B<write>()  is interrupted by a signal handler before any bytes are "
11928 "written, then the call fails with the error B<EINTR>; if it is interrupted "
11929 "after at least one byte has been written, the call succeeds, and returns the "
11930 "number of bytes written."
11931 msgstr ""
11932
11933 #. type: Plain text
11934 #: build/C/man2/write.2:223
11935 msgid ""
11936 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
11937 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
11938 msgstr ""