Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>dos_exterr</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dos_exterr
dosexterr

Usage

   #include <dos.h>
   int dos_exterr(struct DOSERROR *err):
   int dosexterr(struct DOSERROR *err):

Description


   These functions are identical, both names are used to increase
   compatibility with other compilers.

   The function dos_exterr obtains the DOS extended error information which
   is returned from DOS function call 0x59 (89). The information is placed
   in the structure which is pointed to by err. The format of the DOSERROR
   structure is defined in dos.h and is as follows:

   struct DOSERROR
   {
       int exterror;
       char eclass;
       char action;
       char locus;
   };

   If a NULL pointer is passed to dos_exterr , the function will return
   immediately with the extended error number.

   The function dos_exterr is only available with MS-DOS 3.x and above

Example 

   #include <stdio.h>
   #include <dos.h>
   #include <io.h>
   #include <stdlib.h>

   int main()
   {
       int fd;
       struct DOSERROR p;
       if ((fd = open("temp.fil",O_RDONLY,0)) == -1)
           {
           dos_exterr(&p);
           printf("exterr = %d\n",p.exterror);
           printf("class = %d\n",p.class);
           printf("action = %d\n",p.action);
           printf("locus = %d\n",p.locus);

           perror("File open error");
           return EXIT_FAILURE;
           }
       return EXIT_SUCCESS;
   }

Return Value

   Returns the DOS extended error number. A value of 0 means that no error
   occurred in the previous operation.

See Also

   Dos package





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson