Keil Logo


4.6 errno

The C library errno variable is defined in the implicit static data area of the library.

This area is identified by __user_libspace(). The function that returns the address of errno is:
(*(volatile int *) __aeabi_errno_addr())
You can define __aeabi_errno_addr() if you want to place errno at a user-defined location instead of the default location identified by __user_libspace().


Legacy versions of errno.h might define errno in terms of __rt_errno_addr() rather than __aeabi_errno_addr(). The function name __rt_errno_addr() is a legacy from pre-ABI versions of the tools, and is still supported to ensure that object files generated with those tools link successfully.


The return value is a pointer to a variable of type int, containing the currently applicable instance of errno.
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.