Merge "Put struct FILE back how NDK-built apps expect it."
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 7188c74..a4c0264 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -92,6 +92,15 @@
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
+
+ fpos_t _unused_0; // This was the `_offset` field (see below).
+
+ // Do not add new fields here. (Or remove or change the size of any above.)
+ // Although bionic currently exports `stdin`, `stdout`, and `stderr` symbols,
+ // that still hasn't made it to the NDK. All NDK-built apps index directly
+ // into an array of this struct (which was in <stdio.h> historically), so if
+ // you need to make any changes, they need to be in the `__sfileext` struct
+ // below, and accessed via `_EXT`.
};
/*
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index 1066d7f..7e9c439 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -52,7 +52,7 @@
#define std(flags, file) \
{0,0,0,flags,file,{0,0},0,__sF+file,__sclose,__sread,__sseek,__swrite, \
- {(unsigned char *)(__sFext+file), 0},NULL,0,{0},{0},{0,0},0}
+ {(unsigned char *)(__sFext+file), 0},NULL,0,{0},{0},{0,0},0,0}
_THREAD_PRIVATE_MUTEX(__sfp_mutex);