]>
git.saurik.com Git - wxWidgets.git/blob - src/unix/baseunix.cpp
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"
32 #include "wx/apptrait.h"
34 #include "wx/unix/execute.h"
37 #include <sys/types.h>
40 // ============================================================================
41 // wxConsoleAppTraits implementation
42 // ============================================================================
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
48 bool wxConsoleAppTraits::CreateEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
50 // nothing to do, so always ok
55 wxConsoleAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
),
58 // we don't have any pipe
63 wxConsoleAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
70 wxConsoleAppTraits::WaitForChild(wxExecuteData
& execData
)
72 wxASSERT_MSG( execData
.flags
& wxEXEC_SYNC
,
73 wxT("async execution not supported yet") );
76 if ( waitpid(execData
.pid
, &exitcode
, 0) == -1 || !WIFEXITED(exitcode
) )
78 wxLogSysError(_("Waiting for subprocess termination failed"));
84 // ----------------------------------------------------------------------------
86 // ----------------------------------------------------------------------------
88 // WXWIN_OS_DESCRIPTION is normally defined by configure
89 #if defined( __MWERKS__ ) && defined(__MACH__)
90 #define WXWIN_OS_DESCRIPTION "MacOS X"
93 int wxConsoleAppTraits::GetOSVersion(int *verMaj
, int *verMin
)
98 if ( sscanf(WXWIN_OS_DESCRIPTION
, "%255s %d.%d", name
, &major
, &minor
) != 3 )
100 // unreckognized uname string format