Guardian C Library Calls Reference Manual
offsetof
3-136 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
•
In addition to either the CLARGE or CWIDE library file, you must bind the
CNONSTOP library file into programs that use this function.
•
This function can only be used in the Guardian environment.
•
Refer to the Guardian Programmer’s Guide for complete details on fault-tolerant
programming in C.
offsetof
The offsetof macro expands to the offset in bytes of a structure member from the start of
its structure.
struct-type
is a type name denoting a structure type.
struct-member
is an identifier denoting a member of the structure type struct-type.
Return Value
is the offset in bytes of the member struct-member from the beginning of the
structure type struct-type.
Usage Guidelines
•
The offsetof function can be used in static initialization of aggregates.
#include <stddefh>
size_t offsetof(struct-type, struct-member);