]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/driver/Platform.cpp
Vendor import of lldb release_39 branch r276489:
[FreeBSD/FreeBSD.git] / tools / driver / Platform.cpp
1 //===-- Platform.cpp --------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // this file is only relevant for Visual C++
11 #if defined( _WIN32 )
12
13 #include <process.h>
14 #include <assert.h>
15 #include <stdlib.h>
16
17 #include "Platform.h"
18
19 int
20 ioctl (int d, int request, ...)
21 {
22     switch ( request )
23     {
24     // request the console windows size
25     case ( TIOCGWINSZ ):
26         {
27             va_list vl;
28             va_start(vl,request);
29              // locate the window size structure on stack
30              winsize *ws = va_arg(vl, winsize*);
31             // get screen buffer information
32             CONSOLE_SCREEN_BUFFER_INFO info;
33             if ( GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &info ) == TRUE )
34                 // fill in the columns
35                 ws->ws_col = info.dwMaximumWindowSize.X;
36             va_end(vl);
37             return 0;
38         }
39         break;
40     default:
41         assert( !"Not implemented!" );
42     }
43     return -1;
44 }
45
46 int
47 kill (pid_t pid, int sig)
48 {
49     // is the app trying to kill itself
50     if ( pid == getpid( ) )
51         exit( sig );
52     //
53     assert( !"Not implemented!" );
54     return -1;
55 }
56
57 int
58 tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
59 {
60     assert( !"Not implemented!" );
61     return -1;
62 }
63
64 int
65 tcgetattr (int fildes, struct termios *termios_p)
66 {
67 //  assert( !"Not implemented!" );
68     // error return value (0=success)
69     return -1;
70 }
71
72 #endif