The library routines listed in this section behave differently under different operating-system versions. For more information on an individual routine, see the description of that routine in the reference section.
Routine | Restrictions |
_locking _sopen _fsopen | These routines are effective only in DOS versions 3.0 and later. |
_dosexterr | The _dosexterr routine provides error handling for system call 0x59 (get extended error) in DOS versions 3.0 and later. |
_dup _dup2 | The _dup and _dup2 routines can cause unexpected results in DOS versions earlier than 3.0. If you use _dup or _dup2 to create a duplicate file handle for stdin, stdout, stderr, stdaux, or stdprn, calling the _close function with one handle causes errors in later I/O operations that use the other handle. This anomaly does not occur in DOS versions 3.0 and later. |
_exec _spawn | When using the _exec and _spawn families of functions under DOS versions earlier than 3.0, the value of the arg0 argument (or argv[0] to the child process) is not available to the user; a null string ( "" ) is stored in that position instead. In DOS versions 3.0 and later, the arg0 argument contains the complete command path. |
Microsoft C/C++ defines global variables that indicate the version of the current operating system. You can use these to determine the operating-system version in which a program is executing. See Chapter 3, “Global Variables and Standard Types,” for more information.