Low Level I/O.

These functions interface directly with the services provided to assembler programs within the operating system. Unlike other C libraries, the JCC library buffers low level I/O at the device track level. Like other C libraries the input / output is not formatted except that in text-mode fixed-block, padding is added to incomplete records in the form of white space.

In the case of HFS file access, no additional padding is written to files and buffering is handled directly by OMVS.

JCC compiled programs conditionally link the I/O routines depending on the use of at least one JCC I/O library function. If the library has been combined with the program, the runtime automatically and silently attempts to open //DDN:STDIN, //DDN:STDOUT and //DDN:STDERR. These files are accessed with the following predefined handles:

Stream Handle
stdin 0
stdout 1
stderr 2

See JCC library for information about changing the default DD names when the program starts.

Low level I/O routines set the thread-specific errno global variable when an error occurs.

_fmode may by updated to change the default open mode.

Routine Use
__bldl Reports the files (member) block position
_close Closes a file
_commit Commit buffers (does nothing in this implementation.)
_dup Duplicate a file handle
_dup2 Duplicate a file handle to a specific handle
_eof Tests for the End Of File
_filelength Reports the length of a file (reads the entire file)
__getdcb Returns open dataset information
__getdcba Returns the address of a DCB for an open dataset
_isatty Checks for a Terminal device
_lseek Repositions to a location in a file
__note Reports the last read/written block position
_open Opens a file
_read Reads data from a file
remove Delete a file
rename Rename a file
_setmode Sets the translation mode
__setstow Sets aux. close information for member names
_tell Returns the current file position
_unlink Delete a file
_write Writes data to a file