zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
zos.cc File Reference
#include "edcwccwi.h"
#include "zos-getentropy.h"
#include "zos.h"
#include <_Ccsid.h>
#include <_Nascii.h>
#include <__le_api.h>
#include <assert.h>
#include <builtins.h>
#include <ctest.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <iconv.h>
#include <libgen.h>
#include <poll.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/msg.h>
#include <sys/ps.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/inotify.h>
#include <exception>
#include <mutex>
#include <sstream>
#include <unordered_map>
#include <vector>

Classes

struct  timer_parm
 
struct  iarv64parm
 
struct  __hash_func
 
class  __Cache
 
struct  espiearg
 
struct  thunk24
 
struct  loadmod
 
struct  EDOI
 
struct  IFAEDSTA_parms
 
struct  IFAARGS
 

Macros

#define _AE_BIMODAL   1
 
#define _ENHANCED_ASCII_EXT   0xFFFFFFFF
 
#define _XOPEN_SOURCE   600
 
#define _OPEN_SYS_FILE_EXT   1
 
#define _OPEN_MSGQ_EXT   1
 
#define __ZOS_CC
 
#define dsa()   ((unsigned long *)_gdsa())
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define XSTR(a)   STRINGIFY(a)
 
#define STRINGIFY(a)   #a
 
#define DEFAULT_BUILD_STRING    "v" XSTR(MAJOR_VERSION) "." XSTR(MINOR_VERSION) "." XSTR(PATCH_VERSION)
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define PGTH_CURRENT   1
 
#define PGTHACOMMANDLONG   1
 
#define __AttrPacked
 
#define __USE_IARV64   1
 
#define CSG(_op1, _op2, _op3)    __asm volatile(" csg %0,%2,%1 \n " : "+r"(_op1), "+m"(_op2) : "r"(_op3) :)
 
#define CS(_op1, _op2, _op3)    __asm volatile(" cs %0,%2,%1 \n " : "+r"(_op1), "+m"(_op2) : "r"(_op3) :)
 
#define PPA_FUNC_LENGTH   256
 
#define MAP_LE_FUNC(func, offset)   (func = (typeof(func))((unsigned long*)__get_libvec_base() + (offset<<1)))
 
#define CHECK_LE_FUNC(offset)   (__check_le_func((void*)((unsigned long*)__get_libvec_base() + (offset<<1)), ppa_funcname, PPA_FUNC_LENGTH))
 
#define MAP_LE_FUNC_ELSE_ZOSLIB_FUNC(func, zoslibfunc, funcstring, offset)
 

Typedefs

typedef struct timer_parm timer_parm_t
 
typedef unsigned long value_type
 
typedef unsigned long key_type
 
typedef std::unordered_map< key_type, value_type, __hash_func >::const_iterator mem_cursor_t
 
typedef struct thunk24 thunk24_t
 
typedef struct loadmod loadmod_t
 
typedef int IfaedType
 
typedef char IfaedProdOwner[16]
 
typedef char IfaedProdName[16]
 
typedef char IfaedFeatureName[16]
 
typedef char IfaedProdVers[2]
 
typedef char IfaedProdRel[2]
 
typedef char IfaedProdMod[2]
 
typedef char IfaedProdID[8]
 
typedef char IfaedProdToken[8]
 
typedef int IfaedFeaturesLen
 
typedef int IfaedReturnCode
 
typedef struct IFAEDSTA_parms IFAEDSTA_parms_t
 
typedef struct IFAARGS IFAARGS_t
 
typedef int(* zoslib_env_hook_func) (char *)
 

Functions

void * _gdsa ()
 
void __set_ccsid_guess_buf_size (int nbytes)
 
__zinit * __get_instance ()
 
char ** __get_environ_np (void)
 
int __setenv_a (const char *, const char *, int) asm("@@A00188")
 
void __xfer_env (void)
 
int gettid ()
 
int backtrace (void **buffer, int size)
 
char ** backtrace_symbols (void *const *buffer, int size)
 
void backtrace_symbols_fd (void *const *buffer, int size, int fd)
 
void __display_backtrace (int fd)
 
void __abend (int comp_code, unsigned reason_code, int flat_byte, void *plist)
 
int strcasecmp_ignorecp (const char *a, const char *b)
 
int strncasecmp_ignorecp (const char *a, const char *b, size_t n)
 
int get_ipcs_overview (IPCQPROC *info)
 
void __cleanupipc (int others)
 
unsigned long __clock (void)
 
void __settimelimit (int secs)
 
void * __dlcb_next (void *last)
 
int __dlcb_entry_name (char *buf, int size, void *dlcb)
 
void * __dlcb_entry_addr (void *dlcb)
 
int __dlcb_iterate (int(*cb)(char *, void *, void *), void *data)
 
void abort (void)
 
void __set_backtrace_on_abort (bool flag)
 
int __cond_timed_wait (unsigned int secs, unsigned int nsecs, unsigned int event_list, unsigned int *secs_rem, unsigned int *nsecs_rem)
 
int kill (int pid, int sig)
 
int __getargcv (int *argc, char ***argv, pid_t pid)
 
char ** __getargv (void)
 
char ** __getargv_a (void)
 
int __getargc (void)
 
int __getexepath (char *path, int pathlen, pid_t pid)
 
notagread_t __get_no_tag_read_behaviour ()
 
int __get_no_tag_ignore_ccsid1047 ()
 
unsigned long __mach_absolute_time (void)
 
unsigned long getipttoken (void)
 
void * __zalloc (size_t len, size_t alignment)
 
void * anon_mmap (void *_, size_t len)
 
int __zfree (void *addr, int len)
 
int anon_munmap (void *addr, size_t len)
 
int execvpe (const char *name, char *const argv[], char *const envp[])
 
void __atomic_store_real (int size, void *ptr, void *val, int memorder) asm("__atomic_store")
 
int __testread (const void *location)
 
void __tb (void)
 
int clock_gettime (clockid_t clk_id, struct timespec *tp)
 
char * __get_le_version (void)
 
void __build_version (void)
 
void __cpu_relax (__crwa_t *p)
 
void __tcp_clear_to_close (int socket, unsigned int secs)
 
void __unloadmod (void *mod)
 
const char * getIFAUsageErrorString (unsigned long rc)
 
unsigned long long __registerProduct (const char *major_version, const char *product_owner, const char *feature_name, const char *product_name, const char *pid)
 
void * __zalloc_for_fd (size_t len, const char *filename, int fd, off_t offset)
 
void * roanon_mmap (void *_, size_t len, int prot, int flags, const char *filename, int fd, off_t offset)
 
int __print_zoslib_help (FILE *fp, const char *title)
 
int __update_envar_settings (const char *envar)
 
int __update_envar_names (zoslib_config_t *const config)
 
void * __iterate_stack_and_get (void *dsaptr, __stack_info *si)
 
int * __get_stack_start ()
 
unsigned long __get_libvec_base ()
 
int futimes (int fd, const struct timeval tv[2])
 (__EDC_TARGET < 0x42050000) && defined(ZOSLIB_ENABLE_V2R5_FEATURES)
 
int lutimes (const char *filename, const struct timeval tv[2])
 
int __nanosleep (const struct timespec *req, struct timespec *rem)
 
void init_zoslib_config (zoslib_config_t &config)
 
void init_zoslib_config (zoslib_config_t *const config)
 
void init_zoslib (const zoslib_config_t config)
 
int __check_le_func (void *addr, char *funcname, size_t len)
 
bool __doLogMemoryUsage ()
 
void __setLogMemoryUsage (bool v)
 
char * __getMemoryUsageLogFile ()
 
bool __doLogMemoryAll ()
 
bool __doLogMemoryWarning ()
 
void __mainTerminating ()
 

Variables

const char * __zoslib_version = DEFAULT_BUILD_STRING
 
char ** environ
 
const char * MODULE_REGISTER_USAGE = "IFAUSAGE"
 
const char * IFAUsageErrorStrings []
 

Macro Definition Documentation

◆ __AttrPacked

#define __AttrPacked

◆ __USE_IARV64

#define __USE_IARV64   1

◆ __ZOS_CC

#define __ZOS_CC

◆ _AE_BIMODAL

#define _AE_BIMODAL   1

◆ _ENHANCED_ASCII_EXT

#define _ENHANCED_ASCII_EXT   0xFFFFFFFF

◆ _OPEN_MSGQ_EXT

#define _OPEN_MSGQ_EXT   1

◆ _OPEN_SYS_FILE_EXT

#define _OPEN_SYS_FILE_EXT   1

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   600

◆ CHECK_LE_FUNC

#define CHECK_LE_FUNC (   offset)    (__check_le_func((void*)((unsigned long*)__get_libvec_base() + (offset<<1)), ppa_funcname, PPA_FUNC_LENGTH))

◆ CS

#define CS (   _op1,
  _op2,
  _op3 
)     __asm volatile(" cs %0,%2,%1 \n " : "+r"(_op1), "+m"(_op2) : "r"(_op3) :)

◆ CSG

#define CSG (   _op1,
  _op2,
  _op3 
)     __asm volatile(" csg %0,%2,%1 \n " : "+r"(_op1), "+m"(_op2) : "r"(_op3) :)

◆ DEFAULT_BUILD_STRING

#define DEFAULT_BUILD_STRING    "v" XSTR(MAJOR_VERSION) "." XSTR(MINOR_VERSION) "." XSTR(PATCH_VERSION)

◆ dsa

#define dsa ( )    ((unsigned long *)_gdsa())

◆ MAP_LE_FUNC

#define MAP_LE_FUNC (   func,
  offset 
)    (func = (typeof(func))((unsigned long*)__get_libvec_base() + (offset<<1)))

◆ MAP_LE_FUNC_ELSE_ZOSLIB_FUNC

#define MAP_LE_FUNC_ELSE_ZOSLIB_FUNC (   func,
  zoslibfunc,
  funcstring,
  offset 
)
Value:
if (CHECK_LE_FUNC(offset) && strcmp(ppa_funcname, funcstring) == 0) { \
MAP_LE_FUNC(func, offset); \
} else if (zoslibfunc) { \
func = zoslibfunc; \
}
#define CHECK_LE_FUNC(offset)
Definition zos.cc:2931

◆ max

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

◆ MIN

#define MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

◆ PGTH_CURRENT

#define PGTH_CURRENT   1

◆ PGTHACOMMANDLONG

#define PGTHACOMMANDLONG   1

◆ PPA_FUNC_LENGTH

#define PPA_FUNC_LENGTH   256

◆ STRINGIFY

#define STRINGIFY (   a)    #a

◆ XSTR

#define XSTR (   a)    STRINGIFY(a)

Typedef Documentation

◆ IFAARGS_t

typedef struct IFAARGS IFAARGS_t

◆ IfaedFeatureName

typedef char IfaedFeatureName[16]

◆ IfaedFeaturesLen

typedef int IfaedFeaturesLen

◆ IfaedProdID

typedef char IfaedProdID[8]

◆ IfaedProdMod

typedef char IfaedProdMod[2]

◆ IfaedProdName

typedef char IfaedProdName[16]

◆ IfaedProdOwner

typedef char IfaedProdOwner[16]

◆ IfaedProdRel

typedef char IfaedProdRel[2]

◆ IfaedProdToken

typedef char IfaedProdToken[8]

◆ IfaedProdVers

typedef char IfaedProdVers[2]

◆ IfaedReturnCode

typedef int IfaedReturnCode

◆ IFAEDSTA_parms_t

◆ IfaedType

typedef int IfaedType

◆ key_type

typedef unsigned long key_type

◆ loadmod_t

typedef struct loadmod loadmod_t

◆ mem_cursor_t

typedef std::unordered_map<key_type,value_type,__hash_func>::const_iterator mem_cursor_t

◆ thunk24_t

typedef struct thunk24 thunk24_t

◆ timer_parm_t

typedef struct timer_parm timer_parm_t

◆ value_type

typedef unsigned long value_type

◆ zoslib_env_hook_func

typedef int(* zoslib_env_hook_func) (char *)

Function Documentation

◆ __abend()

void __abend ( int  comp_code,
unsigned  reason_code,
int  flat_byte,
void *  plist 
)

Generates an SVC 13 abend.

Parameters
[in]comp_codeCompletion code.
[in]reason_codeReason code.
[in]flat_byteFlat Byte.
[in]plistParameter list.

◆ __atomic_store_real()

void __atomic_store_real ( int  size,
void *  ptr,
void *  val,
int  memorder 
)

◆ __build_version()

void __build_version ( void  )

Prints the build version of the library

◆ __check_le_func()

int __check_le_func ( void *  addr,
char *  funcname,
size_t  len 
)

Check if an LE function is present in the LE vector table

Parameters
[in]addraddress to LE function
[out]funcnamepointer to string that will hold the function name
[out]maxlength of string corresponding to funcname
Returns
returns 1 if successful, 0 if unsuccessful.

◆ __cleanupipc()

void __cleanupipc ( int  others)

Remove IPC semaphores and shared memory.

Parameters
[in]othersnon-zero value indicates remove IPC not associated with current process.

◆ __clock()

unsigned long __clock ( void  )

◆ __cond_timed_wait()

int __cond_timed_wait ( unsigned int  secs,
unsigned int  nsecs,
unsigned int  event_list,
unsigned int *  secs_rem,
unsigned int *  nsecs_rem 
)

Suspend the calling thread until any one of a set of events has occurred or until a specified amount of time has passed.

Parameters
[in]secsseconds to suspend
[in]nsecsnanoseconds to suspend
[in]event_listevents that will trigger thread to resume (CW_INTRPT or CW_CONDVAR)
[out]secs_remseconds remaining
[out]nsecs_remnanoseconds remaining
Returns
returns 0 if successful, -1 if unsuccessful.

◆ __cpu_relax()

void __cpu_relax ( __crwa_t p)

TODO(itodorov) - zos: document these interfaces

◆ __display_backtrace()

void __display_backtrace ( int  fd)

Print backtrace of stack to file descriptor.

Parameters
[in]fdfile descriptor.

◆ __dlcb_entry_addr()

void * __dlcb_entry_addr ( void *  dlcb)

Get address of dlcb entry

Parameters
[in]dlcb- current dlcb
Returns
returns entry address of dlcb

◆ __dlcb_entry_name()

int __dlcb_entry_name ( char *  buf,
int  size,
void *  dlcb 
)

Get entry name of given dlcb

Parameters
[out]buf- DLL name of given dlcb
[in]size- maximum number of bytes
[in]dlcb- current dlcb
Returns
[in] number of bytes written to buf

◆ __dlcb_iterate()

int __dlcb_iterate ( int(*)(char *, void *, void *)  cb,
void *  data 
)

◆ __dlcb_next()

void * __dlcb_next ( void *  last)

Get next dlcb entry

Parameters
[in]last- previous dlcb entry
Returns
[in] returns next dlcb entry

◆ __doLogMemoryAll()

bool __doLogMemoryAll ( )

Returns true if all messages from memory allocation and release are being displayed.

◆ __doLogMemoryUsage()

bool __doLogMemoryUsage ( )

Returns true if logging of memory allocation and release is specified.

◆ __doLogMemoryWarning()

bool __doLogMemoryWarning ( )

Returns true if only warnings from memory allocation and release are being displayed. Errors are always included if memory logging in on.

◆ __get_environ_np()

char ** __get_environ_np ( void  )

Get the environ.

Returns
returns pointer to environment list

◆ __get_instance()

__zinit * __get_instance ( )

◆ __get_le_version()

char * __get_le_version ( void  )

Return the LE version as a string in the format of "Product %d%s Version %d Release %d Modification %d"

◆ __get_libvec_base()

unsigned long __get_libvec_base ( void  )

Gets the LE libvec base address

Returns
libvec base address

◆ __get_no_tag_ignore_ccsid1047()

int __get_no_tag_ignore_ccsid1047 ( )

◆ __get_no_tag_read_behaviour()

notagread_t __get_no_tag_read_behaviour ( )

◆ __get_stack_start()

int * __get_stack_start ( )

Get the stack start address for the current thread

Returns
returns the stack start address

◆ __getargc()

int __getargc ( void  )

Get program argument count of the current process

Returns
returns count of process arguments

◆ __getargcv()

int __getargcv ( int *  argc,
char ***  argv,
pid_t  pid 
)

Get program argument list of a given process id

Parameters
[out]argc- pointer to store count of the arguments
[out]argv- pointer to store an array of pointers that point to each argument
[in]pid- process id to obtain the argc and argv for
Note
Call free(argv) when done accessing argv.
Returns
On success, returns 0, or -1 on error.

◆ __getargv()

char ** __getargv ( void  )

Get program argument list of the current process

Returns
returns an array of process arguments

◆ __getargv_a()

char ** __getargv_a ( void  )

◆ __getexepath()

int __getexepath ( char *  path,
int  pathlen,
pid_t  pid 
)

Get the executable path of a given process id

Parameters
[out]path- pointer to the destination array to copy the null-terminated path to
[in]pathlen- length of the given array
[in]pid- process id to obtain the executable path for
Returns
On success, returns 0, or -1 on error.

◆ __getMemoryUsageLogFile()

char * __getMemoryUsageLogFile ( )

Returns the file name, including "stdout" or "stderr", used to log memory allocation and release to.

◆ __iterate_stack_and_get()

void * __iterate_stack_and_get ( void *  dsaptr,
__stack_info si 
)

Iterate to next stack dsa based on current dsa

Parameters
[in]dsaptr- current dsa entry
[out]si- stack information of next dsa
Returns
returns the next dsa entry in the chain or 0 if not found

◆ __mach_absolute_time()

unsigned long __mach_absolute_time ( void  )

Obtain the mach absolute time

Returns
returns mach absolute time

◆ __mainTerminating()

void __mainTerminating ( )

Tell zoslib that the main process is terminating, for its diagnostics.

◆ __nanosleep()

int __nanosleep ( const struct timespec *  req,
struct timespec *  rem 
)

Suspends the execution of the calling thread until either at least the time specified in *req has elapsed, an event occurs, or a signal arrives.

Parameters
[in]reqstruct used to specify intervals of time with nanosecond precision
[out]remthe remaining time if the call is interrupted

◆ __print_zoslib_help()

int __print_zoslib_help ( FILE fp,
const char *  title 
)

Prints zoslib help information to specified FILE pointer

Parameters
[in]FILEpointer to write to
[in]titleheader, specify NULL for default
Returns
On success, returns 0, or < 0 on error.

◆ __registerProduct()

unsigned long long __registerProduct ( const char *  major_version,
const char *  product_owner,
const char *  feature_name,
const char *  product_name,
const char *  pid 
)

Registers product for SMF 89 Type 1 records using IFAUSAGE macro.

Parameters
[in]major_versionThe major version of Product (e.g. 14)
[in]product_ownerThe product owner (e.g. IBM)
[in]feature_nameThe feature name (e.g. Node.js)
[in]product_nameThe product name (e.g. Node.js for z/OS)
[in]pidThe Product ID (e.g. 5676-SDK)
Returns
returns 0 if successful, non-zero if unsuccessful.

◆ __set_backtrace_on_abort()

void __set_backtrace_on_abort ( bool  flag)

Enable or disable abort() from calling display_backtrace(). Default is true.

◆ __set_ccsid_guess_buf_size()

void __set_ccsid_guess_buf_size ( int  nbytes)

◆ __setenv_a()

int __setenv_a ( const char *  ,
const char *  ,
int   
)

◆ __setLogMemoryUsage()

void __setLogMemoryUsage ( bool  v)

◆ __settimelimit()

void __settimelimit ( int  secs)
extern

◆ __tb()

void __tb ( void  )

◆ __tcp_clear_to_close()

void __tcp_clear_to_close ( int  socket,
unsigned int  secs 
)

Attempts to a close a socket for a period of time

Parameters
[in]socketsocket handle
[in]secsnumber of seconds to attempt the close

◆ __testread()

int __testread ( const void *  location)

TODO(itodorov) - zos: document these interfaces

◆ __unloadmod()

void __unloadmod ( void *  mod)
extern

◆ __update_envar_names()

int __update_envar_names ( zoslib_config_t *const  config)

Changes the names of one or more of the environment variables zoslib uses

Parameters
[in]zoslib_confit_tstructure that defines the new environment variable name(s)
Returns
0 for success, or -1 for failure

◆ __update_envar_settings()

int __update_envar_settings ( const char *  envar)

Updates the zoslib global variables associated with the zoslib environment variables

Parameters
[in]envarenvironment variable to update, specify NULL to update all
Returns
0 for success, or -1 for failure

◆ __xfer_env()

void __xfer_env ( void  )

Convert environment variables from EBCDIC to ASCII.

◆ __zalloc()

void * __zalloc ( size_t  len,
size_t  alignment 
)

Allocate memory in 64-bit virtual storage when size is a megabyte multiple or above 2GB, or in 31-bit storage otherwise, and if none is available, attempt to allocate from 64-bit virtual storage.

Parameters
[in]lenlength in bytes of memory to allocate
[in]alignmentin bytes and applies only to 31-bit storage (64-bit storage is always megabyte-aligned)
Returns
pointer to the beginning of newly allocated memory, or 0 if unsuccessful

◆ __zalloc_for_fd()

void * __zalloc_for_fd ( size_t  len,
const char *  filename,
int  fd,
off_t  offset 
)

Allocate memory (using __zalloc()) and read into it contents of given file

Parameters
[in]lenlength in bytes of memory to allocate
[in]filenamefilename to read
[in]fdfile descriptor
[in]offsetoffset in bytes into the file to read
Returns
pointer to the beginning of newly allocated memory, or 0 if unsuccessful

◆ __zfree()

int __zfree ( void *  addr,
int  len 
)

Deallocate memory

Parameters
[in]addrstart address of memory
[in]lenlength in bytes
Returns
returns 0 if successful, -1 if unsuccessful

◆ _gdsa()

void * _gdsa ( )

◆ abort()

void abort ( void  )

◆ anon_mmap()

void * anon_mmap ( void *  _,
size_t  len 
)

Allocate memory in 64-bit virtual storage when size is a megabyte multiple or above 2GB, or in 31-bit storage (with PAGE_SIZE bytes alignment) otherwise, and if none is available, attempt to allocate from 64-bit virtual storage.

Parameters
[in]_ignored
[in]lenlength in bytes of memory to allocate
Returns
pointer to the beginning of newly allocated memory, or MAP_FAILED if unsuccessful
Deprecated:
This function will be removed once mmap is fully functional (e.g. MAP_ANONYMOUS is supported)

◆ anon_munmap()

int anon_munmap ( void *  addr,
size_t  len 
)

Deallocate memory

Parameters
[in]addrstart address of memory
[in]lenlength in bytes
Returns
returns 0 if successful, -1 if unsuccessful
Deprecated:
This function will be removed once mmap is fully functional (e.g. MAP_ANONYMOUS is supported)

◆ backtrace()

int backtrace ( void **  buffer,
int  size 
)

Generate a backtrace and store into *Buffer.

Parameters
[out]bufferAddress of location to store backtrace to.
[in]sizeMaximum number of bytes to store.
Returns
if successful, returns 0, otherwise -1

◆ backtrace_symbols()

char ** backtrace_symbols ( void *const *  buffer,
int  size 
)

Generate a backtrace symbols and store into *Buffer.

Parameters
[out]bufferAddress of location to store backtrace to.
[in]sizeMaximum number of bytes to store.
Returns
if successful, an array of strings, otherwise returns NULL.

◆ backtrace_symbols_fd()

void backtrace_symbols_fd ( void *const *  buffer,
int  size,
int  fd 
)

Generate a backtrace symbols and store into *Buffer.

Parameters
[out]bufferAddress of location to store backtrace to.
[in]sizeMaximum number of bytes to store.
[in]fdfile descriptor.

◆ clock_gettime()

int clock_gettime ( clockid_t  clk_id,
struct timespec *  tp 
)

◆ execvpe()

int execvpe ( const char *  name,
char *const  argv[],
char *const  envp[] 
)

Execute a file.

Parameters
[in]nameused to construct a pathname that identifies the new process image file.
[in]argvan array of character pointers to NULL-terminated strings.
[in]envpan array of character pointers to NULL-terminated strings.
Returns
if successful, it doesn't return; otherwise, it returns -1 and sets errno.

◆ futimes()

int futimes ( int  fd,
const struct timeval  tv[2] 
)

(__EDC_TARGET < 0x42050000) && defined(ZOSLIB_ENABLE_V2R5_FEATURES)

Changes the access and modification times of a file

Parameters
[in]fdfile descriptor to modify
[in]tvtimeval structure containing new time
Returns
return 0 for success, or -1 for failure.

◆ get_ipcs_overview()

int get_ipcs_overview ( IPCQPROC *  info)

Returns the overview structure of IPCQPROC

Parameters
[out]infoaddress of allocated IPCQPROC structure
Returns
On success, returns 0, or -1 on error.

◆ getIFAUsageErrorString()

const char * getIFAUsageErrorString ( unsigned long  rc)

Retrieves error message from __registerProduct IFAUSAGE macro.

Parameters
[in]rcreturn code from __registerProduct.
Returns
returns error message as C character string.

◆ getipttoken()

unsigned long getipttoken ( void  )

◆ gettid()

int gettid ( )

Get the Thread ID.

Returns
returns the current thread id

◆ init_zoslib()

void init_zoslib ( const zoslib_config_t  config)

Initialize zoslib library

Parameters
[in]configstruct to configure zoslib.

◆ init_zoslib_config() [1/2]

void init_zoslib_config ( zoslib_config_t config)

◆ init_zoslib_config() [2/2]

void init_zoslib_config ( zoslib_config_t *const  config)

Initialize the struct used to configure zoslib with default values.

Parameters
[in]configstruct to configure zoslib.

◆ kill()

int kill ( int  pid,
int  sig 
)

◆ lutimes()

int lutimes ( const char *  filename,
const struct timeval  tv[2] 
)

Changes the access and modification times of a file

Parameters
[in]filenamefile path to modify
[in]tvtimeval structure containing new time
Returns
return 0 for success, or -1 for failure.

◆ roanon_mmap()

void * roanon_mmap ( void *  _,
size_t  len,
int  prot,
int  flags,
const char *  filename,
int  fd,
off_t  offset 
)

Allocate memory (using __zalloc()) and read into it contents of given file at the given offset.

Parameters
[in]_ignored
[in]lenlength in bytes of memory map
[in]protprotection bits
[in]flagsmmap flags
[in]filenamefilename to read
[in]fdfile descriptor
[in]offsetoffset in bytes into the file to read
Returns
pointer to the beginning of newly allocated memory, or MAP_FAILED if unsuccessful
Deprecated:
This function will be removed once mmap is fully functional (e.g. MAP_ANONYMOUS is supported), in which case mapped memory would need to be converted to ASCII if the file contains EBCDIC.

◆ strcasecmp_ignorecp()

int strcasecmp_ignorecp ( const char *  a,
const char *  b 
)

String case comparision that ignores code page.

Parameters
[in]a- null-terminated character string.
[in]b- null-terminated character string.
Returns
if equal, returns 0, otherwise returns non-zero.

◆ strncasecmp_ignorecp()

int strncasecmp_ignorecp ( const char *  a,
const char *  b,
size_t  n 
)

String case comparision that ignores code page.

Parameters
[in]a- Character String.
[in]b- Character String.
[in]n- Number of bytes to compare.
Returns
if equal, returns 0, otherwise returns non-zero.

Variable Documentation

◆ __zoslib_version

const char* __zoslib_version = DEFAULT_BUILD_STRING

◆ environ

char** environ
extern

◆ IFAUsageErrorStrings

const char* IFAUsageErrorStrings[]
Initial value:
= {
NULL,
"SYSTEM MANAGEMENT FACILITIES (SMF) is not present on the system."
"SYSTEM MANAGEMENT FACILITIES (SMF) Usage Collection "
"Services is not active.",
NULL,
"Another product has already registered under the TASK domain."
" IFAUSAGE will record the data for each product.",
NULL, NULL, NULL,
"IFAUSAGE could not process more than two problem state program"
" invocations of REQUEST=REGISTER for the TASK domain.",
NULL, NULL, NULL,
"You specified a token on the PRTOKEN parameter that the system"
" cannot identify.",
NULL, NULL, NULL,
"IFAUSAGE cannot complete processing because SMF usage processing"
" is not available on the system."}

◆ MODULE_REGISTER_USAGE

const char* MODULE_REGISTER_USAGE = "IFAUSAGE"