Link MSL_C/direct_io

This commit is contained in:
Cuyler36
2025-07-04 17:50:29 -04:00
parent 34d0466983
commit 0bbd6f3dea
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -824,7 +824,7 @@ config.libs = [
Object(NonMatching, "MSL_C.PPCEABI.bare.H/arith.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/buffer_io.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/ctype.c"),
Object(NonMatching, "MSL_C.PPCEABI.bare.H/direct_io.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/direct_io.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/e_acos.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/e_atan2.c"),
Object(Matching, "MSL_C.PPCEABI.bare.H/e_rem_pio2.c"),
+4 -5
View File
@@ -58,6 +58,10 @@ size_t __fwrite(const void* buffer, size_t size, size_t count, FILE* stream) {
if (num_bytes > bytes_to_go)
num_bytes = bytes_to_go;
if (stream->file_mode.buffer_mode == 1 && num_bytes > 0 && (newline = __memrchr(write_ptr, '\n', num_bytes))) {
num_bytes = (size_t)newline + 1 - (size_t)write_ptr;
}
if (num_bytes) {
memcpy(stream->buffer_ptr, write_ptr, num_bytes);
@@ -69,11 +73,6 @@ size_t __fwrite(const void* buffer, size_t size, size_t count, FILE* stream) {
stream->buffer_length -= num_bytes;
}
if (!stream->buffer_length && (int)stream->file_mode.file_kind == __string_file) {
bytes_written += bytes_to_go;
break;
}
if (!stream->buffer_length || newline != NULL || (stream->file_mode.buffer_mode == _IONBF)) {
ioresult = __flush_buffer(stream, NULL);