Changeset 921


Ignore:
Timestamp:
Jul 31, 2011, 8:18:19 PM (9 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/process/child: Added checking the stdin/out/err handle type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/process/child/child.c

    r919 r921  
    22#include <stdlib.h>
    33#include <fcntl.h>
     4#include <io.h>
     5
     6#ifdef __OS2__
     7
     8#define INCL_DOSFILEMGR
     9#include <os2.h>
     10
     11void doDosQueryHType(HFILE hfile)
     12{
     13    ULONG type, attr;
     14    APIRET arc = DosQueryHType(hfile, &type, &attr);
     15    if (arc == 0)
     16        printf("DosQueryHType(%ld) type %lx attr %lx\r\n", hfile, type, attr);
     17    else
     18        printf("DosQueryHType(%ld) rc %ld\r\n", hfile, arc);
     19}
     20
     21#endif
    422
    523int main(int argc, char *argv[])
     
    927    char        buffer[4096];
    1028
    11 #ifdef __OS2__   
     29#ifdef __OS2__
    1230    _fsetmode(stdin, "b");
    1331    _fsetmode(stdout, "b");
     
    1533#endif
    1634
     35        printf("isatty(stdin) %d\r\n", isatty(fileno(stdin)));
     36        printf("isatty(stdout) %d\r\n", isatty(fileno(stdout)));
     37        printf("isatty(stderr) %d\r\n", isatty(fileno(stderr)));
     38
     39#ifdef __OS2__
     40    doDosQueryHType((HFILE)0);
     41    doDosQueryHType((HFILE)1);
     42    doDosQueryHType((HFILE)2);
     43#endif
     44   
    1745    if( argc > 2 )
    1846    {
Note: See TracChangeset for help on using the changeset viewer.