e6250a0c130a78042e183986abf86fe3ecf33d3d
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: unix/baseunix.cpp
3 // Purpose: misc stuff only used in console applications under Unix
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // License: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
30 #include "wx/apptrait.h"
33 #include <sys/types.h>
36 // ============================================================================
37 // wxConsoleAppTraits implementation
38 // ============================================================================
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 bool wxConsoleAppTraits::CreateEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
46 // nothing to do, so always ok
51 wxConsoleAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
),
54 // we don't have any pipe
59 wxConsoleAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
66 wxConsoleAppTraits::WaitForChild(wxExecuteData
& execData
)
68 wxASSERT_MSG( execData
.flags
& wxEXEC_SYNC
,
69 wxT("async execution not supported yet") );
72 if ( waitpid(execData
.pid
, &exitcode
, 0) == -1 || !WIFEXITED(exitcode
) )
74 wxLogSysError(_("Waiting for subprocess termination failed"));
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------
84 // WXWIN_OS_DESCRIPTION is normally defined by configure
85 #if defined( __MWERKS__ ) && defined(__MACH__)
86 #define WXWIN_OS_DESCRIPTION "MacOS X"
89 int wxConsoleAppTraits::GetOSVersion(int *verMaj
, int *verMin
)
94 if ( sscanf(WXWIN_OS_DESCRIPTION
, "%s %d.%d", name
, &major
, &minor
) != 3 )
96 // unreckognized uname string format