Also add missing declarations to misc. functions. Fix clearerr() implementation (previous was broken). Handle feature test macros like _POSIX_C_SOURCE properly. Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
Change-Id: Iffd41046fd0933c66542abf7627a1569522dfcb2