__wsinit() — Reinitialize writable static

Standards

Standards / Extensions C or C++ Dependencies
C Library both  

Format

#include <unistd.h>

int __wsinit(void (*func_ptr)());

General description

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.

Returned value

If successful, __wsinit() returns 0 .

If unsuccessful, __wsinit() returns -1 and sets errno to one of the following values:
Error Code
Description
EINVAL
func_ptr is not a valid fetch pointer.