dosinit
Purpose
Initializes the DOS Services environment.
Library
DOS Services Library (libdos.a)
Syntax
#include <dos.h>
int dosinit ( )
Description
The dosinit subroutine initializes the run-time environ-
ment required by the DOS Services subroutines. Programs
must call the dosinit subroutine before using any of the
DOS Services subroutines.
The dosinit subroutine looks for the initialization
information in the following places:
1. It attempts to read the information from the file
named by DOSENVT. DOSENVT is a variable in the AIX
environment. The dos command (or any parent process)
creates this file by calling the dosunopen subroutine
before starting a child process.
2. If the DOSENVT variable is not set, then dosinit con-
figures DOS Services based on the AIX environment
variables in the following list.
3. For the AIX variables that are not defined, the
default values shown in the following are used.
AIX Variable Default Value
DOS_NUL /dev/null
DOS_CON /dev/tty
DOS_COM1 /dev/tty0
DOS_COM2 /dev/tty1
DOS_AUX /dev/tty0
DOS_LP0 /dev/lp0
DOS_LP1 /dev/lp1
DOS_LP2 /dev/lp2
. .
DOS_LP7 /dev/lp7
DOS_A /dev/fd0
DOS_B /dev/fd0
DOS_C $HOME
DOS_D /
DOS_E No default
DOS_F No default
. .
DOS_Z No default.
Note: If $HOME is set to /, or if it is undefined, then
the default directory for DOS_C is /usr/dos.
The value assigned to each of these variables must be
either:
o The full AIX path name of an accessible device, file,
or directory, or
o A string in the form "|"command, where command is an
AIX command. The specified command receives, as its
standard input, the data that DOS Services programs
write to the corresponding logical device.
The dosinit subroutine also uses the following environ-
ment variable:
DOSDISK Specifies the initial default drive for
DOS Services. If DOSDISK is not set, then
dosinit searches sequentially from A: to Z:
and sets the default drive to the first
valid file system found.
The AIX environment variables that specify the DOS Ser-
vices configuration can be set in the system /etc/profile
file, in the user's $HOME/.profile, or directly from the
AIX command line. See the sh command in AIX Operating
System Commands Reference for more information about
setting AIX environment variables, which are also called
shell variables.
The AIX environment variables are accessed only once
during a single session started by the dos command. From
then on, internal configuration tables are used.
Return Value
Upon successful completion dosinit returns a value of 0.
Otherwise a value of -1 is returned, and doserrno is set
to indicate the error.
Related Information
In this book: "DOS services library," "dosread,"
"dosunopen, dosreopen," and "doswrite."
The dos and sh commands in AIX Operating System Commands
Reference.