1.7.8 Using high-level functions when exploiting the C library

High-level I/O functions can be used if the low-level functions are re-implemented.

High-level I/O functions are those such as fprintf(), printf(), scanf(), puts(), fgets(), fread(), fwrite(), and perror(). Low-level functions are those such as fputc(), fgetc(), and __backspace(). Most of the formatted output functions also require a call to setlocale().

Anything that uses locale must not be called before first calling setlocale().setlocale() selects the appropriate locale. For example, setlocale(LC_ALL, "C"), where LC_ALL means that the call to setlocale() affects all locale categories, and "C" specifies the minimal environment for C translation. Locale-using functions include the functions in ctype.h and locale.h, the printf() family, the scanf() family, ato*, strto*, strcoll/strxfrm, and most of time.h.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.