Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
system
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The system function passes <command> to the command interpreter,
which executes the string as an operating-system command. Under
OS/2, the command is executed synchronously. The system function
refers to the COMSPEC and PATH environment variables that locate
the command interpreter file: COMMAND.COM in DOS or CMD.EXE in
OS/2. If <command> is a pointer to a NULL string, the function
simply checks whether the command interpreter exists.
Return Value
If <command> is NULL and the command interpreter is found, the
function returns a nonzero value. If the command interpreter is
not found, it returns the value 0 and sets errno to ENOENT. If
<command> is not NULL, the system function returns the value 0 if
the command interpreter is successfully started. Under OS/2, the
system function returns the exit status from the command
interpreter.
A return value of -1 indicates an error, and errno is set to
E2BIG, ENOENT, ENOEXEC, or ENOMEM.
-♦-