]>
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"
33 #include "wx/unix/execute.h"
36 #include <sys/types.h>
39 // ============================================================================
40 // wxConsoleAppTraits implementation
41 // ============================================================================
43 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
47 bool wxConsoleAppTraits::CreateEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
49 // nothing to do, so always ok
54 wxConsoleAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
),
57 // we don't have any pipe
62 wxConsoleAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
))
69 wxConsoleAppTraits::WaitForChild(wxExecuteData
& execData
)
71 wxASSERT_MSG( execData
.flags
& wxEXEC_SYNC
,
72 wxT("async execution not supported yet") );
75 if ( waitpid(execData
.pid
, &exitcode
, 0) == -1 || !WIFEXITED(exitcode
) )
77 wxLogSysError(_("Waiting for subprocess termination failed"));
83 // ----------------------------------------------------------------------------
85 // ----------------------------------------------------------------------------
87 // WXWIN_OS_DESCRIPTION is normally defined by configure
88 #if defined( __MWERKS__ ) && defined(__MACH__)
89 #define WXWIN_OS_DESCRIPTION "MacOS X"
92 int wxConsoleAppTraits::GetOSVersion(int *verMaj
, int *verMin
)
97 if ( sscanf(WXWIN_OS_DESCRIPTION
, "%255s %d.%d", name
, &major
, &minor
) != 3 )
99 // unreckognized uname string format