API

There’s only a limited number of APIs to document, as the rest is covered by the C11 <threads.h> documentation. Therefore, we only document the new parts and the additions that this library specializes in.

ztdc_thrd_native_handle_t type and functions

typedef __ztdc_thrd_native_handle_t ztdc_thrd_native_handle_t

The native handle type for this platform.

ztdc_thrd_native_handle_t ztdc_thrd_native_handle(thrd_t __thr)

Returns the native handle out of __thr.

Parameters:

__thr[in] The thread to get the native, platform-specific handle for.

Returns:

The native “handle” object which represents __thr. May be an invalid sentinel type if it can’t fetch it properly.

ztdc_thrd_native_handle_t ztdc_thrd_current_native_handle(void)

Returns the native handle out of the current thread.

Returns:

The native “handle” object which represents this thread. May be an invalid sentinel type if it can’t fetch it properly.

const ztdc_thrd_native_handle_t ztdc_thrd_null_native_handle

The null native handle value, which represents an invalid native handle.

ztdc_thrd_id_t type and functions

typedef __ztdc_thrd_id_t ztdc_thrd_id_t

The native id type for this platform.

ztdc_thrd_id_t ztdc_thrd_id(thrd_t __thr)

Returns the native id out of __thr.

Parameters:

__thr[in] The thread to get the native, platform-specific ID for.

Returns:

The native “ID” object which represents __thr. May be an invalid sentinel type if __thr is not the original object created by the thread.

ztdc_thrd_id_t ztdc_thrd_current_id(void)

Returns the native id out of the current thread.

Returns:

The native “ID” object which represents this thread. May be an invalid sentinel type if this.

const ztdc_thrd_id_t ztdc_thrd_null_id

The null id value, which represents an invalid id.

ztdc_thrd_attr_err_func_t function type and functions

int() ztdc_thrd_attr_err_func_t (const ztdc_thrd_attr_kind *__kind, int __err, void *__userdata)

A function that is called when an attribute is not honored by an implementation. The first parameter is the attribute passed into the function that does not work.

Remark

This function is always invoked on the same thread where the pointer to this function was provided for use in a thread creation function.

Param __kind:

[in] A pointer to the attribute’s ztdc_thrd_attr_kind-typed first field.

Param __err:

[in] The error that the implementation provided. It can be any thread error except thrd_success.

Param __userdata:

[in] The user data passed in to the thrd_create_arrs_err function.

Return:

The return value is a thread error. Returning thrd_success means to ignore the error. Any other return value means the function will stop and the thread creation will cease.

int ztdc_thrd_ignore_all_attr_errors(const ztdc_thrd_attr_kind *__kind, int __err, void *__userdata)

A ztdc_thrd_attr_err_func_t that returns thrd_success unconditionally.

Parameters:
  • __kind[in] The thread attribute kind. Ignored.

  • __err[in] The error that occurred. Ignored.

  • __userdata[in] A pointer to some userdata, or null. Ignored.

Returns:

thrd_success.

int ztdc_thrd_stop_on_attr_error(const ztdc_thrd_attr_kind *__kind, int __err, void *__userdata)

A ztdc_thrd_attr_err_func_t that returns the error it was called with unconditionally. Has the effect of stopping on the first thread attribute that errors.

Parameters:
  • __kind[in] The thread attribute kind. Ignored.

  • __err[in] The error that occurred.

  • __userdata[in] A pointer to some userdata, or null. Ignored.

Returns:

__err.

ztdc_thrd_create_attrs_err function

int ztdc_thrd_create_attrs_err(thrd_t *__thr, thrd_start_t __func, void *__arg, size_t __attrs_size, const ztdc_thrd_attr_kind **__attrs, ztdc_thrd_attr_err_func_t *__attr_err_func, void *__attr_err_func_arg)

Starts a thread and configures that thread with the given thread attributes, if any. Any failure in the threads is completely and totally ignored.

Remark

Equivalent to ztdc_thrd_create_attrs_err(__thr, __func, __attrs_size, __attrs, NULL, NULL);.

Parameters:
  • __thr[out] A pointer to the thread object that is populated with the information on success.

  • __func[in] The function to invoke if the thread is successfully created and ran.

  • __arg[in] The arg to provide to __func if it successfully starts.

  • __attrs_size[in] The size of the __attrs array.

  • __attrs[in] An array of pointers to the first member of either a standard or implementation-defined thread attribute structure that is at least __attrs_size large. If __attrs_size is 0, this can be a null pointer. Unknown attributes are skipped.

  • __attr_err_func[in] The function for handling when attributes cause errors. It is invoked on the same thread as the invocation of the overall ztdc_thrd_create_attr_err invocation. Returning thrd_success means that the error should be passed over and/or ignored for that given attribute. Otherwise, returning any other thread error results in the function returning with that error code. If it is NULL, then the implementation assumes that any failed application of a thread attribute should be passed over and ignored.

  • __attr_err_func_arg[in] The arg to provide to the attribute error function if its ever invoked.

Returns:

thrd_success on creation, and one of the thread error codes otherwise.

ztdc_thrd_create_attrs function

int ztdc_thrd_create_attrs(thrd_t *__thr, thrd_start_t __func, void *__arg, size_t __attrs_size, const ztdc_thrd_attr_kind **__attrs)

Starts a thread and configures that thread with the given thread attributes, if any. Any failure in the thread attributes is completely and totally ignored by default. Such errors can be caught by using ztdc_thrd_create_attrs_err.

Remark

Equivalent to ztdc_thrd_create_attrs_err(__thr, __func, __attrs_size, __attrs, NULL, NULL);.

Parameters:
  • __thr – A pointer to the thread object that is populated with the information on success.

  • __func – The function to invoke if the thread is successfully created and ran.

  • __arg – The arg to provide to __func if it successfully starts.

  • __attrs_size – The size of the __attrs array.

  • __attrs – An array of pointers to the first member of either a standard or implementation-defined thread attribute structure that is at least __attrs_size large. If __attrs_size is 0, this can be a null pointer. Unknown attributes are skipped.

Returns:

thrd_success on creation, and one of the thread error codes otherwise.

ztdc_thrd_attr_kind enumeration

This enumeration is the core of the library. Every standard

enum ztdc_thrd_attr_kind

An enumeration containing all of the standard and implementation-defined thread attributes.

Remark

The first [0, 65’535] for the standard, and 2,147,418,112 reserved values [65’636, 2’147’483’647] for implementation-defined attributes. Each value of the enumeration corresponds to a structure that describes something for the thread to use.

Values:

enumerator ztdc_thrd_attr_kind_mcname

A name provided in the execution encoding to be transformed and stored as the thread name. Corresponds to the structure ztdc_thrd_attr_mcname.

enumerator ztdc_thrd_attr_kind_mwcname

A name provided in the execution encoding to be transformed and stored as the thread name. Corresponds to the structure ztdc_thrd_attr_mwcname.

enumerator ztdc_thrd_attr_kind_c8name

A name provided in the UTF-8 encoding to be transformed and stored as the thread name. Corresponds to the structure ztdc_thrd_attr_c8name.

enumerator ztdc_thrd_attr_kind_stack_size

The expected stack size for the implementation. Corresponds to the structure ztdc_thrd_attr_stack_size.

enumerator ztdc_thrd_attr_kind_detached

Whether or not this thread should be started detached. Corresponds to the structure ztdc_thrd_attr_detached.

enumerator ztdc_thrd_attr_kind_custom_on_origin

A custom function that is called on the originating thread to perform any custom actions on the thread. Gives the newly created thread, the native thread handle, and the native thread ID alongside a user data. Is invoked after all other thread attributes are applied.

enumerator ztdc_thrd_attr_kind_custom_on_new

A custom function that is called on the new thread to perform any custom actions on the thread. Gives the newly created thread, the native thread handle, and the native thread ID alongside a user data. Is invoked after all other thread attributes are applied.

enumerator ztdc_thrd_attr_kind_implementation_defined

The last standard-defined attribute that marks the beginning of the implementation-defined attributes. Corresponds to nothing and is just for informational purposes.

enumerator ztdc_thrd_attr_kind__stack_storage

A pointer and a size representing the whole piece of memory to use for the stack. Implementation-defined and not cross-platform. Corresponds to the structure ztdc_thrd_attr__stack_storage.

enumerator ztdc_thrd_attr_kind__stack_guard_size

A size dictating how big the guard area on one or both sides of the stack might be. Implementation-defined and not cross-platform. Corresponds to the structure ztdc_thread_attr__stack_guard_size.

enumerator ztdc_thrd_attr_kind_name

A raw, direct name copied unmodified into the thread name descriptor. Corresponds to the structure ztdc_thrd_attr__name_sized.

enumerator ztdc_thrd_attr__kind_name_sized

A raw, direct name copied unmodified into the thread name descriptor. Includes the size. Corresponds to the structure ztdc_thrd_attr__name_sized.

enumerator ztdc_thrd_attr__kind_mcname_sized

A name provided in the execution encoding to be transformed and stored as the thread name. Includes the size. Corresponds to the structure ztdc_thrd_attr__mcname_sized.

enumerator ztdc_thrd_attr__kind_mwcname_sized

A name provided in the execution encoding to be transformed and stored as the thread name. Includes the size. Corresponds to the structure ztdc_thrd_attr__mwcname_sized.

enumerator ztdc_thrd_attr__kind_c8name_sized

A name provided in the UTF-8 encoding to be transformed and stored as the thread name. Includes the size. Corresponds to the structure ztdc_thrd_attr__c8name_sized.

enumerator ztdc_thrd_attr_kind__c16name

A name provided in the UTF-16 encoding to be transformed and stored as the thread name. Corresponds to the structure ztdc_thrd_attr__c16name.

enumerator ztdc_thrd_attr__kind_c16name_sized

A name provided in the execution encoding to be transformed and stored as the thread name. Includes the size. Corresponds to the structure ztdc_thrd_attr__c16name_sized.

enumerator ztdc_thrd_attr_kind__c32name

A name provided in the UTF-32 encoding to be transformed and stored as the thread name. Corresponds to the structure ztdc_thrd_attr__c32name.

enumerator ztdc_thrd_attr__kind_c32name_sized

A name provided in the UTF-32 encoding to be transformed and stored as the thread name. Includes the size. Corresponds to the structure ztdc_thrd_attr__c32name_sized.

ztdc_thrd_attr_* standard structures

These are standard structures, useful to dictate behavior across platforms. Certain platforms have different limits on different parts of the attributes for threads: it may take some experimentation to make it work. Every structure has a ztdc_thrd_attr_kind as the first member in order for the enumerator’s address to double as the address of the structure, and allow for well-defined casting to the appropriate type.

Note

All attributes are processed on the thread that invoked one of the attribute-handling thread creation functions, except for ztdc_thrd_attr_custom_on_new, which is invoked on the new thread. ztdc_thrd_attr_custom_on_new and ztdc_thrd_attr_custom_on_origin are always invoked after all other attributes have been processed in attrs (and no errors have occurred). ztdc_thrd_attr_custom_on_new is processed before ztdc_thrd_attr_custom_on_origin, and none of their functions are ever invoked in parallel. The processing of all attributes synchronizes before the start of the actual passed-in thread function.

struct ztdc_thrd_attr_mcname

Describes a name encoded in the execution encoding for the implementation to transcode to the a suitable internally-named string, if applicable.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_mcname.

const char *name

The execution encoding name.

struct ztdc_thrd_attr_mwcname

Describes a name encoded in the wide execution encoding for the implementation to transcode to the a suitable internally-named string, if applicable.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_mwcname.

const ztd_wchar_t *name

The wide execution encoding name.

struct ztdc_thrd_attr_c8name

Describes a name encoded in the UTF-8 encoding for the implementation to transcode to the a suitable internally-named string, if applicable.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_c8name.

const ztd_char8_t *name

The UTF-8 encoding name. Null terminated.

struct ztdc_thrd_attr_stack_size

Describes a request for a specific stack size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_stack_size.

size_t size

The size of the stack space. Some implementations produce an error when requested and the size is too large or small. Other implementations will round the size up if it is too small. Use ztdc_thrd_create_attrs_err to detect whether or not this parameter has taken successfully.

struct ztdc_thrd_attr_detached

Describes whether or not the thread should start detached or not.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_detached.

bool detached

Whether or not the thread should be spawned immediately detached or not.

struct ztdc_thrd_attr_custom_on_new

Describes an attribute that will invoke a custom function on the newly created thread object.

Remark

This is invoked on the new thread. func will never be invoked concurrently with ztdc_thrd_attr_custom_on_origin. This always runs before ztdc_thrd_attr_custom_on_origin.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_custom_on_new.

ztdc_thrd_attr_func_t *func

The function to process the thread, native thread handle and native thread id.

Remark

This function is always invoked on the thread of the function that is creating the thread. To invoke this function on the originating thread, just before the thread function is called, see ztdc_thrd_attr_custom_on_origin.

void *userdata

The user data argument to pass to func.

struct ztdc_thrd_attr_custom_on_origin

Describes an attribute that will invoke a custom function on the newly created thread object.

Remark

This is invoked on the originating thread. func will never be invoked concurrently with ztdc_thrd_attr_custom_on_new. This always runs after ztdc_thrd_attr_custom_on_origin if both of these are present.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_custom_on_origin.

ztdc_thrd_attr_func_t *func

The function to process the native thread handle and native thread id.

Remark

This function is always invoked on the originating thread that is creating the new thread. To invoke this function on the newly created thread instead rather than the originating thread, just before the thread function is called, see ztdc_thrd_attr_custom_on_new.

void *userdata

The userdata to pass to func.

ztdc_thrd_attr_* implementation-defined structures

These structures are less portable and do not work across platforms.

struct ztdc_thrd_attr__stack_storage

Implementation-defined stack buffer attribute. Works on typical POSIX thread implementations.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind__stack_storage.

size_t size

The size of the buffer to be used as the stack for the thread.

void *buffer

The size of the.

struct ztdc_thrd_attr__stack_guard_size

Implementation-defined stack guard size attribute. Works only on typical POSIX thread implementations.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind__stack_guard_size.

size_t size

The size of the stack’s guard, in bytes. Can be placed at just the start of the stack’s reserved space, or the beginning and the end of the stack’s reserved/committed space (it is determined by the implementation).

struct ztdc_thrd_attr__mcname_sized

Describes a name encoded in the execution encoding for the implementation to transcode to the a suitable internally-named string, if applicable. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_mcname_sized.

size_t size

The size of the name. Must not include a null terminator in its range.

const char *name

The execution encoding name.

struct ztdc_thrd_attr__mwcname_sized

Describes a name encoded in the wide execution encoding for the implementation to transcode to the a suitable internally-named string, if applicable. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_mwcname_sized.

size_t size

The size of the name. Must not include a null terminator in its range.

const ztd_wchar_t *name

The wide execution encoding name.

struct ztdc_thrd_attr__c8name_sized

Describes a name encoded in the UTF-8 encoding for the implementation to transcode to the a suitable internally-named string, if applicable. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_c8name_sized.

size_t size

The size of the name. Must not include a null terminator in its range.

const ztd_char8_t *name

The UTF-8 encoding name.

struct ztdc_thrd_attr__c16name

Describes a name encoded in the UTF-16 encoding for the implementation to transcode to the a suitable internally-named string, if applicable.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind__c16name.

const ztd_char16_t *name

The UTF-8 encoding name.

struct ztdc_thrd_attr__c16name_sized

Describes a name encoded in the UTF-16 encoding for the implementation to transcode to the a suitable internally-named string, if applicable. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_c16name_sized.

size_t size

The size of the name. Must not include a null terminator in its range.

const ztd_char16_t *name

The UTF-8 encoding name.

struct ztdc_thrd_attr__c32name

Describes a name encoded in the UTF-32 encoding for the implementation to transcode to the a suitable internally-named string, if applicable.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind__c32name.

const ztd_char32_t *name

The UTF-32 encoding name. Null terminated.

struct ztdc_thrd_attr__c32name_sized

Describes a name encoded in the UTF-32 encoding for the implementation to transcode to the a suitable internally-named string, if applicable. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_c32name_sized.

size_t size

The size of the name. Must not include a null terminator in its range.

const ztd_char32_t *name

The UTF-32 encoding name.

struct ztdc_thrd_attr__name

Describes a direct, raw name for the implementation to use without modification.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr_kind_name.

const void *name

A pointer to the data that represents the name. It is null-terminated with an implementation-defined number of bytes representing that null termination. How many bytes make up a valid null terminator is determined by the implementation.

Remark

For Windows, this is typically 2 bytes (16 bits). For POSIX-derivative implementations, this is usually one byte (8 bits). On some exotic implementations, it can be four bytes (32 bits).

struct ztdc_thrd_attr__name_sized

Describes a direct, raw name for the implementation to use without modification. Includes the size.

Public Members

ztdc_thrd_attr_kind kind

The kind of the attribute. Must be ztdc_thrd_attr__kind_name_sized.

size_t size

The size of the data pointer. For the range denoted by the pointer name and this size parameter, it must not contain one of the implementation-defined null terminators for the data within.

const void *name

A pointer to the data that represents the name. How many bytes make up a valid null terminator is determined by the implementation.

Remark

For Windows, this is typically 2 bytes (16 bits). For POSIX-derivative implementations, this is usually one byte (8 bits). On some exotic implementations, it can be four bytes (32 bits).

ztdc_thrd_set_name functions

int ztdc_thrd_set_native_name(thrd_t __thr, const void *__buffer)

Sets the name of the thread, if possible.

Remark

The buffer is treated as a null-terminated string of an implementation-defined type.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the implementation-defined null-terminated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_set_mcname(thrd_t __thr, const char *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the execution encoding, null-terinated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_set_mwcname(thrd_t __thr, const ztd_wchar_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the wide execution encoding, null-terinated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_set_c8name(thrd_t __thr, const ztd_char8_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the UTF-8 null-terinated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_set_c16name(thrd_t __thr, const ztd_char16_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the UTF-16 null-terinated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_set_c32name(thrd_t __thr, const ztd_char32_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer[in] A pointer to the UTF-32 null-terinated string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

ztdc_thrd_get_name functions

int ztdc_thrd_get_native_name(thrd_t __thr, size_t __buffer_size, void *__buffer)

Sets the name of the thread, if possible.

Remark

The name is assumed to be of the right type and thus very little copying takes place.

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the implementation-defined string, in bytes.

  • __buffer[in] A pointer to the implementation-defined string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_get_mcname(thrd_t __thr, size_t __buffer_size, char *__buffer)

Sets the name of the thread, if possible.

Remark

Errors may or may not work on this, synchronization primitives for holding ignored.S

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the execution encoding buffer.

  • __buffer[inout] A pointer to recieve the execution encoding string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_get_mwcname(thrd_t __thr, size_t __buffer_size, ztd_wchar_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the wide execution encoding buffer.

  • __buffer[inout] A pointer to recieve the wide execution encoding string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_get_c8name(thrd_t __thr, size_t __buffer_size, ztd_char8_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the UTF-8 buffer.

  • __buffer[inout] A pointer to recieve the UTF-8 string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_get_c16name(thrd_t __thr, size_t __buffer_size, ztd_char16_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the UTF-16 buffer.

  • __buffer[inout] A pointer to recieve the UTF-16 string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

int ztdc_thrd_get_c32name(thrd_t __thr, size_t __buffer_size, ztd_char32_t *__buffer)

Sets the name of the thread, if possible.

Remark

The thread name will be converted to an internal encoding, if necessary, for the platform.

Parameters:
  • __thr[in] The thread to name.

  • __buffer_size[in] The size of the UTF-32 buffer.

  • __buffer[inout] A pointer to recieve the UTF-32 string.

Returns:

thrd_success if setting the name works, or some other thread error if it fails.

ZTDC_THRD_* bounds macros

ZTDC_THRD_MAXIMUM_NAME_SIZE

The maximum number of bytes an implementation can store for the name without needing to allocate or running out of internal space. String sizes less than this (including the null terminator).

Remark

This value may be “0” and thus should have its use guarded when used for e.g. an array size.

ZTDC_THRD_MINIMUM_STACK_SIZE

The absolute minimum stack size an implementation can tolerate.

Remark

This is only a suggestion: implementations can raise or lower stack sizes through means at run time and compilation time.