1 //===-- Platform.cpp --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // this file is only relevant for Visual C++
19 // the control handler or SIGINT handler
20 static sighandler_t _ctrlHandler = NULL;
22 // the default console control handler
24 WINAPI CtrlHandler (DWORD ctrlType)
26 if ( _ctrlHandler != NULL )
35 ioctl (int d, int request, ...)
39 // request the console windows size
44 // locate the window size structure on stack
45 winsize *ws = va_arg(vl, winsize*);
46 // get screen buffer information
47 CONSOLE_SCREEN_BUFFER_INFO info;
48 if ( GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &info ) == TRUE )
49 // fill in the columns
50 ws->ws_col = info.dwMaximumWindowSize.X;
56 assert( !"Not implemented!" );
62 kill (pid_t pid, int sig)
64 // is the app trying to kill itself
65 if ( pid == getpid( ) )
68 assert( !"Not implemented!" );
73 tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
75 assert( !"Not implemented!" );
80 tcgetattr (int fildes, struct termios *termios_p)
82 // assert( !"Not implemented!" );
83 // error return value (0=success)
89 signal (int sig, sighandler_t sigFunc)
95 _ctrlHandler = sigFunc;
96 SetConsoleCtrlHandler( CtrlHandler, TRUE );
103 // ignore these for now
106 assert( !"Not implemented!" );