File tree 5 files changed +21
-13
lines changed
5 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -1462,6 +1462,7 @@ try:
1462
1462
['stdio' , [
1463
1463
'__overflow.c' ,
1464
1464
'__toread.c' ,
1465
+ '__towrite.c' ,
1465
1466
'__uflow.c' ,
1466
1467
]],
1467
1468
['stdlib' , [
Original file line number Diff line number Diff line change 41
41
W _ZnwjRKSt9nothrow_t
42
42
T __floatscan
43
43
T __overflow
44
- T __seek_on_exit
45
44
T __shgetc
46
45
T __shlim
47
46
W __strtod_l
48
47
W __strtof_l
49
48
W __strtold_l
50
49
T __toread
51
- W __towrite_used
50
+ T __towrite
52
51
T __uflow
53
52
T _err
54
53
T _errx
Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ Differences from upstream musl include:
10
10
* Disable FLOCK, FUNLOCK and FFINALLOCK
11
11
* Simplify fputwc to not rely on musl stream internals
12
12
* signgam is no longer a weak alias of __signgam.
13
-
13
+ * __toread and __towrite have had shutdown functionality removed.
Original file line number Diff line number Diff line change @@ -12,13 +12,3 @@ int __toread(FILE *f)
12
12
f -> rpos = f -> rend = f -> buf ;
13
13
return 0 ;
14
14
}
15
-
16
- static const int dummy = 0 ;
17
- weak_alias (dummy , __towrite_used );
18
-
19
- void __stdio_exit (void );
20
-
21
- void __seek_on_exit ()
22
- {
23
- if (!__towrite_used ) __stdio_exit ();
24
- }
Original file line number Diff line number Diff line change
1
+ #include "stdio_impl.h"
2
+
3
+ int __towrite (FILE * f )
4
+ {
5
+ f -> mode |= f -> mode - 1 ;
6
+ if (f -> flags & (F_NOWR )) {
7
+ f -> flags |= F_ERR ;
8
+ return EOF ;
9
+ }
10
+ /* Clear read buffer (easier than summoning nasal demons) */
11
+ f -> rpos = f -> rend = 0 ;
12
+
13
+ /* Activate write through the buffer. */
14
+ f -> wpos = f -> wbase = f -> buf ;
15
+ f -> wend = f -> buf + f -> buf_size ;
16
+
17
+ return 0 ;
18
+ }
You can’t perform that action at this time.
0 commit comments