The POSIX 1003.1 and X/Open CAE Specification 4.2 (XPG4.2) require
that the C system header files define certain external variables.
Additional variables are defined for use with POSIX or XPG4.2 functions.
If you define one of the POSIX or XPG4 feature test macros and include
one of these headers, the external variables will be defined in your
program. These external variables are treated differently compared
with other global variables in a multithreaded environment (values
are thread-specific) and across a call to a fetched module (values
are propagated).
To access the global variable values the following must be specified
during C/C++ compiles and
z/OS® bind:
- Non-XPLINK (non-thread-safe)
- C code must be compiled with the RENT or DLL option (C++ code
needs no additional options). The SCEEOBJ autocall library must be
specified during the bind.
- Non-XPLINK (thread-safe)
- No additional options are required for either C or C++. The _SHARE_EXT_VARS
feature test macro, or the necessary _SHR_ prefixed feature test macros must be used.
Equivalently,
the necessary thread-specific functions can be called directly (as
documented below under each external variable).
- XPLINK (non-thread-safe)
- No additional options (besides XPLINK) are
required for either C or C++. The C runtime library side-deck, member
CELHS003 of the SCEELIB data set, must
be included during the bind. (c89/cc/c++ automatically include this
side-deck when the XPLINK link
edit option (for example, c89 -Wl,XPLINK ...)
is used.)
- XPLINK (thread-safe)
- No additional options (besides XPLINK) are
required for either C or C++. The C runtime library side-deck, member
CELHS003 of the SCEELIB dataset, must
be included during the bind.
The _SHARE_EXT_VARS feature test
macro, or the necessary _SHR_ prefixed feature test macros must be
used. Equivalently, the necessary thread-specific functions
can be called directly (as documented in the topics under each external
variable).
- LP64 (non-thread-safe)
- No additional options (besides LP64 ) are required for either
C or C++. The C runtime library side-deck, member CELQS003 of the
SCEELIB dataset, must be included
during the bind.
The _SHARE_EXT_VARS feature test macro, or the
necessary _SHR_ prefixed feature test macros must be used.
Equivalently, the necessary thread-specific functions
can be called directly (as documented in the topics under each external
variable).
- LP64 (thread-safe)
- No additional options (besides LP64 ) are required for either
C or C++. The C runtime library side-deck, member CELQS003 of the
SCEELIB dataset, must be included
during the bind. (c89/cc/c++ automatically include this side-deck
when the LP64 link edit option (for example, c89 -Wl, LP64 ...) is
used.)
The _SHARE_EXT_VARS feature
test macro, or the necessary _SHR_ prefixed feature test macros must
be used.
Equivalently, the necessary thread-specific
functions can be called directly (as documented in the topics under
each external variable).
errno
When
a runtime library function fails, the function may do any of the following
to identify the error:
- Set errno to a documented value.
- Set errno to a value that is not documented. You can use strerror()
or perror() to get the message associated with the errno.
- Not set errno.
- Clear errno.
See also
errno.h.
daylight
Daylight
savings time flag set by tzset(). Note that other time zone sensitive
functions such as ctime(), localtime(), mktime(), and strftime() implicitly
call tzset().
Note: Use the __dlght() function to
access the thread-specific value of daylight.
See
also
time.h.
getdate_err
The
variable is set to the value below when an error occurs in the getdate()
function.
- The DATEMSK environment variable is NULL or undefined.
- The template file cannot be opened for reading.
- Failed to get file status information.
- The template file is not a regular file.
- An error was encountered while reading the template file.
- Memory allocation failed (not enough memory available).
- No line in the template file matches the input specification.
- Non-valid input specification. For example, February 31; or a
time that can not be represented in a time_t (representing the time
is seconds since Epoch - midnight, January 1, 1970 (UTC)).
- Unable to determine current time.
Any changes to errno are unspecified.
Note: This value
is unique for z/OS UNIX.
The getdate64()
interface affects the same pointer to the thread-specific value of
getdate_err and uses the same getdate_err values as the getdate()
interface.
Note: Use the__gderr() function to access the
thread-specific value of getdate_err. The getdate64()
function affects the same pointer to the thread-specific value of
getdate_err as the getdate() function does.
See also time.h.
h_errno
An
integer which holds the specific error code when the network name
server encounters an error. The network name server is used by the
gethostbyname() and gethostbyaddr() functions.
Note: Use the__h_errno() function
to access the thread-specific value of h_errno.
See also netdb.h.
Note: This variable is kept for
historical reasons. However, it is used only in connection with the
functions gethostbyaddr() and gethostbyname(), which are obsolescent
in Single UNIX Specification,
Version 3, so that the h_errno variable may also be withdrawn in the
future.
__loc1
Restriction: This external variable is not
supported in AMODE 64
A global character pointer which is
set by the regex() function to point to the first matched character
in the input string. Use the ____loc1() function to access
the thread-specific value of __loc1.
Note: This
variable is kept for historical reasons. It was part of the Legacy
Feature in Single UNIX Specification,
Version 2, but has been withdrawn and is not supported as part of
Single UNIX Specification,
Version 3. New applications should use the interfaces supported by
the <regex.h> header, which provide full internationalized regular
expression functionality compatible with IEEE Std 1003.1-2001 Regular
Expressions.
If it is necessary to continue using this symbol
in an application written for Single UNIX Specification,
Version 3, define the feature test macro _UNIX03_WITHDRAWN before
including any standard system headers. The macro exposes all interfaces
and symbols removed in Single UNIX Specification,
Version 3. See also libgen.h.
loc1
Restriction: This
external variable is not supported in AMODE 64.
A pointer
to characters matched by regular expressions used by step(). The value
is not propagated across a call to a fetched module.
Note: This
variable is kept for historical reasons. It was part of the Legacy
Feature in Single UNIX Specification,
Version 2, but has been withdrawn and is not supported as part of
Single UNIX Specification,
Version 3. New applications should use the interfaces supported by
the <regex.h> header, which provide full internationalized regular
expression functionality compatible with IEEE Std 1003.1-2001 Regular
Expressions. See also regexp.h.
loc2
Restriction: This
external variable is not supported in AMODE 64
A pointer
to characters matched by regular expressions used by step(). The value
is not propagated across a call to a fetched module.
Note: This
variable is kept for historical reasons. It was part of the Legacy
Feature in Single UNIX Specification,
Version 2, but has been withdrawn and is not supported as part of
Single UNIX Specification,
Version 3. New applications should use the interfaces supported by
the <regex.h> header, which provide full internationalized regular
expression functionality compatible with IEEE Std 1003.1-2001 Regular
Expressions. See also regexp.h.
locs
Restriction: This
external variable is not supported in AMODE 64
Used by advance()
to stop regular expression matching in a string. The value is not
propagated across a call to a fetched module. See also regexp.h.
Note: This
variable is kept for historical reasons. It was part of the Legacy
Feature in Single UNIX Specification,
Version 2, but has been withdrawn and is not supported as part of
Single UNIX Specification,
Version 3. New applications should use the interfaces supported by
the <regex.h> header, which provide full internationalized regular
expression functionality compatible with IEEE Std 1003.1-2001 Regular
Expressions.
optarg
Character
pointer used by getopt() for options parsing variables.
Note: Use
the__opargf() function to access the thread-specific value
of optarg.
Note: This variable has been
removed from stdio.h by Single UNIX Specification,
Version 3 and is exposed for Version 3 only in unistd.h . See also stdio.h and unistd.h.
opterr
Error
value used by getopt().
Note: Use the __operrf() function
to access the thread-specific value of opterr.
Note: This
variable has been removed from stdio.h by Single UNIX Specification, Version 3 and is exposed
for Version 3 only in unistd.h. See also stdio.h and unistd.h.
optind
Integer
pointer used by getopt() for options parsing variables.
Note: Use
the__opindf() function to access the thread-specific value
of optind.
Note: This variable has been
removed from stdio.h by Single UNIX Specification,
Version 3 and is exposed for Version 3 only in unistd.h. See also stdio.h and unistd.h.
optopt
Integer
pointer used by getopt() for options parsing variables.
Note: Use
the__opoptf() function to access the thread-specific value
of optopt.
Note: This variable has been
removed from stdio.h by Single UNIX Specification,
Version 3 and is exposed for Version 3 only in unistd.h. See also stdio.h and unistd.h.
signgam
Storage
for sign of lgamma(). This function defaults to thread-specific. See
also math.h.
stderr
Standard
Error stream. The external variable will be initialized to point to
the enclave-level stream pointer for the standard error file. There
is no multithreaded function. See also stdio.h.
stdin
Standard
Input stream. The external variable will be initialized to point
to the enclave-level stream pointer for the standard input file. There
is no multithreaded function. See also stdio.h.
stdout
Standard
Output stream. The external variable will be initialized to point
to the enclave-level stream pointer for the standard output file.
There is no multithreaded function. See also stdio.h.
t_errno
An
integer which holds the specific error code when a failure occurs
in one of the X/Open Transport Interface (XTI) functions. Use the
__t_errno() function to
access the thread-specific value of
t_errno.
Note: Use
the__t_errno() function to access the thread-specific value
of t_errno.
See also
xti.h.
timezone
Long
integer difference from UTC and standard time as set by tzset(). Note
that other time zone sensitive functions such as ctime(), localtime(),
mktime(), and strftime() implicitly call tzset().
Note: Use the __tzone()
function to access the thread-specific value of timezone.
See also
time.h.
tzname
Character
pointer to unsized array of timezone strings used by tzset() and ctime().
The *tzname variable contains the Standard and Daylight Savings time
zone names. If the TZ environment variable is present and correct,
tzname will be set from TZ. Otherwise tzname will be set from the
LC_TOD locale category. See the tzset() function for a description.
There is no multithreaded function. See also time.h.