The FOMTLOUT module (
/bin/fomtlout) performs the logout
function.
**********************************************************************
*
* Function:
* --------
*
* This function uses the utmpx
* functions to locate and remove the caller's USERID from the utmpx
* file. This routine is a SETUID program, so that it can write to the
* utmpx file.
*
* note: This routine removes the caller's session from the utmpx file
* whenever it is called. If this routine is called erroneously
* (when the user is not really logging off) it will go ahead and
* remove the session from the utmpx file. This will destroy the
* integrity of the utmpx file.
* Parameters:
* ----------
*
* 1:IN argc -- usual main() parameters
*
* 2:IN argv -- usual main() parameters
*
* argv[0] = program name ("fomtlinc")
*
* argv[1] = exit status (as a %d-coded integer value)
*
* argv[2] = (not used)
*
* argv[3] = (not used)
*
* argv[4] = debug level (as a %d-coded integer = 0 to 5)
*
* others -- test only arguments follow
*
*
*
* assumed file descriptors on entry:
*
* 0 -- master TTY (needed for ttyname()
* 1 -- might be a debug fd (debug messages written here)
* 2 -- might be an error fd (for system error messages)
*
*
* Return Value:
* ------------
*
* 1-byte exit status contains 2 bits of syscall ID and 6 bits of
* compressed errno information for the parent. This information is
* used only by the TSO/E OMVS command to put out logoff-oriented
* error messages to the user's terminal.
* Non-returning Exits: none
* -------------------
*
*
* Main Side Effects:
* -----------------
*
* The caller's session is removed from the utmpx file