File tree Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Expand file tree Collapse file tree 2 files changed +7
-30
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ extern "C" {
21
21
* that need to call into the kernel as system calls
22
22
*/
23
23
24
- #if defined(CONFIG_NEWLIB_LIBC ) || defined(CONFIG_ARCMWDT_LIBC ) || defined( CONFIG_PICOLIBC )
24
+ #if defined(CONFIG_NEWLIB_LIBC ) || defined(CONFIG_ARCMWDT_LIBC )
25
25
26
26
/* syscall generation ignores preprocessor, ensure this is defined to ensure
27
27
* we don't have compile errors
@@ -31,12 +31,17 @@ __syscall int zephyr_read_stdin(char *buf, int nbytes);
31
31
__syscall int zephyr_write_stdout (const void * buf , int nbytes );
32
32
33
33
#else
34
- /* Minimal libc */
34
+ /* Minimal libc and picolibc */
35
35
36
36
__syscall int zephyr_fputc (int c , FILE * stream );
37
37
38
+ #ifdef CONFIG_MINIMAL_LIBC
39
+ /* Minimal libc only */
40
+
38
41
__syscall size_t zephyr_fwrite (const void * ZRESTRICT ptr , size_t size ,
39
42
size_t nitems , FILE * ZRESTRICT stream );
43
+ #endif
44
+
40
45
#endif /* CONFIG_NEWLIB_LIBC */
41
46
42
47
/* Handle deprecated malloc arena size configuration values */
Original file line number Diff line number Diff line change @@ -73,34 +73,6 @@ void __stdin_hook_install(unsigned char (*hook)(void))
73
73
__stdin .flags |= _FDEV_SETUP_READ ;
74
74
}
75
75
76
- int z_impl_zephyr_read_stdin (char * buf , int nbytes )
77
- {
78
- int i = 0 ;
79
-
80
- for (i = 0 ; i < nbytes ; i ++ ) {
81
- * (buf + i ) = getchar ();
82
- if ((* (buf + i ) == '\n' ) || (* (buf + i ) == '\r' )) {
83
- i ++ ;
84
- break ;
85
- }
86
- }
87
- return i ;
88
- }
89
-
90
- int z_impl_zephyr_write_stdout (const void * buffer , int nbytes )
91
- {
92
- const char * buf = buffer ;
93
- int i ;
94
-
95
- for (i = 0 ; i < nbytes ; i ++ ) {
96
- if (* (buf + i ) == '\n' ) {
97
- putchar ('\r' );
98
- }
99
- putchar (* (buf + i ));
100
- }
101
- return nbytes ;
102
- }
103
-
104
76
#include <zephyr/sys/cbprintf.h>
105
77
106
78
struct cb_bits {
You can’t perform that action at this time.
0 commit comments