Changeset 29e7cc7 in mainline for uspace/lib/c/generic/io/kio.c
- Timestamp:
- 2025-04-18T15:14:10Z (8 months ago)
- Children:
- e77c3ed
- Parents:
- 800d188 (diff), 25fdb2d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/lib/c/generic/io/kio.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/kio.c
r800d188 r29e7cc7 34 34 */ 35 35 36 #include <abi/syscall.h> 36 37 #include <stddef.h> 37 38 #include <libc.h> … … 112 113 } 113 114 115 size_t kio_read(char *buf, size_t n, size_t at) 116 { 117 return __SYSCALL3(SYS_KIO_READ, (sysarg_t) buf, n, at); 118 } 119 114 120 /** Print formatted text to kio. 115 121 * … … 131 137 } 132 138 133 static int kio_vprintf_str_write(const char *str, size_t size, void *data)139 static errno_t kio_vprintf_str_write(const char *str, size_t size, void *data) 134 140 { 135 size_t wr; 136 137 wr = 0; 138 (void) kio_write(str, size, &wr); 139 return str_nlength(str, wr); 140 } 141 142 static int kio_vprintf_wstr_write(const char32_t *str, size_t size, void *data) 143 { 144 size_t offset = 0; 145 size_t chars = 0; 146 size_t wr; 147 148 while (offset < size) { 149 char buf[STR_BOUNDS(1)]; 150 size_t sz = 0; 151 152 if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK) 153 kio_write(buf, sz, &wr); 154 155 chars++; 156 offset += sizeof(char32_t); 157 } 158 159 return chars; 141 size_t wr = 0; 142 return kio_write(str, size, &wr); 160 143 } 161 144 … … 172 155 printf_spec_t ps = { 173 156 kio_vprintf_str_write, 174 kio_vprintf_wstr_write,175 157 NULL 176 158 };
Note:
See TracChangeset
for help on using the changeset viewer.
