Component: ISO C startup/termination

Macro name

CYGPKG_LIBC_STARTUP

Type

Dummy

Description

This component manages the control of the environment (in the general sense) that the C library provides for use for full ISO C compatibility, including a main() entry point supplied with arguments and an environment (as retrievable by the getenv() function). It also includes at the other end of things, what happens when main() returns or exit() is called.

Option: Arguments to main()

Macro name

CYGDAT_LIBC_ARGUMENTS

Type

String

Description

This option allows the setting of the arguments to the main function. This only has any effect when cyg_iso_c_start() is used to start the ISO C compatibility. This will automatically invoke main() in an ISO C compatible fashion. This option is in fact used as argv, and so is an n-tuple of string constants. The final entry must be NULL. Conventionally if argv[0] is supplied, it is used to inform the program of its name.

Component: main() invoked as thread

Macro name

CYGSEM_LIBC_STARTUP_MAIN_THREAD

Type

Boolean

Description

It is normally expected (e.g. in a POSIX 1003.1 environment) that main() is run in the context of a thread just like any other thread. If this option is disabled then main() will instead be called in the context of the initialization routines, without the scheduler running and using the interrupt stack. This means that any functions that may require interactions with a running kernel will not work (including libc functions, if configured to be thread safe for example), so you should restrict yourself to only calling fully re-entrant functions from within main() in this case.

Option: main()"s thread stack size

Macro name

CYGNUM_LIBC_MAIN_STACK_SIZE

Type

Count

Description

With an eCos kernel, when the cyg_iso_c_start() function is used to invoke the user-supplied main() function in an ISO C compatible fashion, a separate thread is created to call main(). This option controls the size of that thread"s stack, which is allocated in the BSS. It must be a multiple of 8. Note, a low number here may be overridden by the HAL if there is a minimum requirement to process interrupts etc.

Component: Include atexit() function

Macro name

CYGFUN_LIBC_ATEXIT

Type

Boolean

Description

This option enables the use of the atexit() function, and ensure that the atexit handlers are invoked from within exit() as defined in the ISO C standard.

Option: Number of functions atexit() supports

Macro name

CYGNUM_LIBC_ATEXIT_HANDLERS

Type

Count

Description

This option sets the number of functions that atexit() has room for. In other words, the number of separate atexit() calls that can be made before calling exit() or returning from main() ( in an environment controlled by cyg_iso_c_start() ). For strict compliance with the ISO C standard this should be at least 32.

Option: Make exit() call fflush()

Macro name

CYGSEM_LIBC_EXIT_CALLS_FFLUSH

Type

Boolean

Description

This option will ensure that all output streams are flushed when exiting using exit() as prescribed by the ISO C standard.

Option: _exit() stops all threads

Macro name

CYGSEM_LIBC_EXIT_STOPS_SYSTEM

Type

Boolean

Description

If this option is enabled then _exit(), which is called from exit() which itself is called on return from main(), stops the eCos scheduler. For strict POSIX 1003.1 compatibility this would be the normal behavior. To allow the thread to simply exit, without affecting other threads, simply disable this option. If there is no eCos scheduler, then _exit() simply loops irrespective of the setting of this option.

Component: Provide a system environment

Macro name

CYGPKG_LIBC_ENVIRONMENT

Type

Boolean

Description

This option allows use of the getenv() function and the global environment pointer char **environ defined by POSIX 1003.1. Disabling this saves a small amount of space.

Option: Default environment

Macro name

CYGDAT_LIBC_DEFAULT_ENVIRONMENT

Type

String

Description

This option allows the setting of the default contents of the environment. This is in fact the contents of the global environment pointer char **environ defined by POSIX 1003.1. Strings must be of the form NAME=VALUE, and the final entry must be NULL.

Option: Invoke default static constructors

Macro name

CYGSEM_LIBC_INVOKE_DEFAULT_STATIC_CONSTRUCTORS

Type

Boolean

Description

This option causes the C library to call static constructors with default priority from within the context of the main() thread, working with the co-operation of the HAL. This may be needed for environments that expect static constructors to be run in a thread context. Note that this uses an object with priority 65534. Therefore do not use priority 65534 for any other static objects with this option enabled.