Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C Library | both |
#include <unistd.h>
int __wsinit(void (*func_ptr)());
The __wsinit() function reinitializes the writable static area of a module that was loaded by the fetch() library call. func_ptr must be a valid fetch pointer returned by fetch() or fetchep(). If the module contains C++, __wsinit() first runs any C++ static destructors, then __wsinit() runs the static constructors that are present in the load module.
Program variables with the static or extern storage class and writable strings receive the initial value defined in the program, if any initial value was assigned. The C header files contain external variable declarations for those variables defined by the POSIX, XPG4 and XPG4.2 standards. If the fetched module contains these variables, __wsinit() reinitializes them as described in z/OS XL C/C++ Programming Guide.
If successful, __wsinit() returns 0 .