zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
Macros | Functions
zos-io.cc File Reference
#include "zos-base.h"
#include <_Ccsid.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/inotify.h>
#include <utmpx.h>

Macros

#define _AE_BIMODAL   1
 

Functions

void __console (const void *p_in, int len_i)
 
int __console_printf (const char *fmt,...)
 
int vdprintf (int fd, const char *fmt, va_list ap)
 
int dprintf (int fd, const char *fmt,...)
 
void __dump_title (int fd, const void *addr, size_t len, size_t bw, const char *format,...)
 
void __dump (int fd, const void *addr, size_t len, size_t bw)
 
int __find_file_in_path (char *out, int size, const char *envvar, const char *file)
 
int __chgfdccsid (int fd, unsigned short ccsid)
 
int __chgpathccsid (char *pathname, unsigned short ccsid)
 
int __setfdccsid (int fd, int t_ccsid)
 
int __copyfdccsid (int sourcefd, int destfd)
 
int __setfdbinary (int fd)
 
int __setfdtext (int fd)
 
int __disableautocvt (int fd)
 
int __chgfdcodeset (int fd, char *codeset)
 
int __getfdccsid (int fd)
 
int __getLogMemoryFileNo ()
 
void __setLogMemoryUsage (bool value)
 
void __memprintf (const char *format,...)
 
int __pipe_orig (int[2]) asm("pipe")
 
int __socketpair_orig (int domain, int type, int protocol, int sv[2]) asm("socketpair")
 
int __close_orig (int) asm("close")
 
int __open_orig (const char *filename, int opts,...) asm("@@A00144")
 
int __mkstemp_orig (char *) asm("@@A00184")
 
FILE__fopen_orig (const char *filename, const char *mode) asm("@@A00246")
 
int __mkfifo_orig (const char *pathname, mode_t mode) asm("@@A00133")
 
struct utmpx * __getutxent_orig (void) asm("getutxent")
 
int utmpxname (char *file)
 
struct utmpx * __getutxent_ascii (void)
 
int __open_ascii (const char *filename, int opts,...)
 
FILE__fopen_ascii (const char *filename, const char *mode)
 
int __pipe_ascii (int fd[2])
 
int __mkfifo_ascii (const char *pathname, mode_t mode)
 
int __mkstemp_ascii (char *tmpl)
 
int __close (int fd)
 
int __socketpair_ascii (int domain, int type, int protocol, int sv[2])
 

Macro Definition Documentation

◆ _AE_BIMODAL

#define _AE_BIMODAL   1

Function Documentation

◆ __chgfdccsid()

int __chgfdccsid ( int  fd,
unsigned short  ccsid 
)

Change file descriptor to CCSID.

Parameters
[in]fdfile descriptor.
[in]ccsidCCSID.
Returns
returns 0 if successful, or -1 on failure.

◆ __chgfdcodeset()

int __chgfdcodeset ( int  fd,
char *  codeset 
)

Change file descriptor to CCSID from a codeset

Parameters
[in]fdfile descriptor.
[in]codesetcode set
Returns
returns 0 if successful, or -1 on failure.

◆ __chgpathccsid()

int __chgpathccsid ( char *  pathname,
unsigned short  ccsid 
)

◆ __close()

int __close ( int  fd)

◆ __close_orig()

int __close_orig ( int  )

◆ __console()

void __console ( const void *  p_in,
int  len_i 
)

Print given buffer to MVS Console.

◆ __console_printf()

int __console_printf ( const char *  fmt,
  ... 
)

Print formatted data to MVS Console.

◆ __copyfdccsid()

int __copyfdccsid ( int  sourcefd,
int  destfd 
)

Copy ccsid from source fd to destination fd

Parameters
[in]sourcefdfile descriptor.
[in]destfdfile descriptor.
Returns
returns 0 if successful, or -1 on failure.

◆ __disableautocvt()

int __disableautocvt ( int  fd)

Disable auto-conversion on file descriptors

Parameters
[in]fdfile descriptor.
Returns
returns 0 if successful, or -1 on failure.

◆ __dump()

void __dump ( int  fd,
const void *  addr,
size_t  len,
size_t  bw 
)

Dump to console.

◆ __dump_title()

void __dump_title ( int  fd,
const void *  addr,
size_t  len,
size_t  bw,
const char *  format,
  ... 
)

Dump title to console.

◆ __find_file_in_path()

int __find_file_in_path ( char *  out,
int  size,
const char *  envvar,
const char *  file 
)

Finds file in a given path

Parameters
[out]outFound path string
[in]sizeMax size of path string
[in]envarEnvironment variable to search
[in]filefile to search
Returns
returns non-zero if successful, 0 if not found.

◆ __fopen_ascii()

FILE * __fopen_ascii ( const char *  filename,
const char *  mode 
)

Same as C open but tags new files as ASCII (819)

◆ __fopen_orig()

FILE * __fopen_orig ( const char *  filename,
const char *  mode 
)

◆ __getfdccsid()

int __getfdccsid ( int  fd)

Get file descriptor CCSID.

Parameters
[in]fdfile descriptor.
Returns
returns file descriptors ccsid.

◆ __getLogMemoryFileNo()

int __getLogMemoryFileNo ( )

Returns the fileno to which memory diagnostics is written (use for instance in a __display_backtrace(__getLogMemoryFileNo()); call).

◆ __getutxent_ascii()

struct utmpx * __getutxent_ascii ( void  )

◆ __getutxent_orig()

struct utmpx * __getutxent_orig ( void  )

◆ __memprintf()

void __memprintf ( const char *  format,
  ... 
)

Logs memory allocation and release to the file name specified in the environment variable zoslib_config_t.MEMORY_USAGE_LOG_FILE_ENVAR.

Parameters
[in]sameas C's printf() parameters

◆ __mkfifo_ascii()

int __mkfifo_ascii ( const char *  pathname,
mode_t  mode 
)

Same as C mkfifo but tags FIFO special files as ASCII (819)

◆ __mkfifo_orig()

int __mkfifo_orig ( const char *  pathname,
mode_t  mode 
)

◆ __mkstemp_ascii()

int __mkstemp_ascii ( char *  tmpl)

◆ __mkstemp_orig()

int __mkstemp_orig ( char *  )

◆ __open_ascii()

int __open_ascii ( const char *  filename,
int  opts,
  ... 
)

Same as C open but tags new files as ASCII (819)

◆ __open_orig()

int __open_orig ( const char *  filename,
int  opts,
  ... 
)

◆ __pipe_ascii()

int __pipe_ascii ( int  fd[2])

◆ __pipe_orig()

int __pipe_orig ( int  [2])

◆ __setfdbinary()

int __setfdbinary ( int  fd)

Change file descriptor to binary

Parameters
[in]fdfile descriptor.
Returns
returns 0 if successful, or -1 on failure.

◆ __setfdccsid()

int __setfdccsid ( int  fd,
int  t_ccsid 
)

Set file descriptor to the provided CCSID.

Parameters
[in]fdfile descriptor.
[in]t_ccsidCCSID.
Returns
returns 0 if successful, or -1 on failure.

◆ __setfdtext()

int __setfdtext ( int  fd)

Change file descriptor to text (819 or controlled via envar)

Parameters
[in]fdfile descriptor.
Returns
returns 0 if successful, or -1 on failure.

◆ __setLogMemoryUsage()

void __setLogMemoryUsage ( bool  value)
extern

◆ __socketpair_ascii()

int __socketpair_ascii ( int  domain,
int  type,
int  protocol,
int  sv[2] 
)

◆ __socketpair_orig()

int __socketpair_orig ( int  domain,
int  type,
int  protocol,
int  sv[2] 
)

◆ dprintf()

int dprintf ( int  fd,
const char *  fmt,
  ... 
)

Debug Printf.

Returns
returns total number of bytes written to file descriptor

◆ utmpxname()

int utmpxname ( char *  file)

◆ vdprintf()

int vdprintf ( int  fd,
const char *  fmt,
va_list  ap 
)

Variadic Debug Printf.

Returns
returns total number of bytes written to file descriptor