]>
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 // this is in mac/utils.cpp under Mac
91 int wxConsoleAppTraits::GetOSVersion(int *verMaj
, int *verMin
)
96 if ( sscanf(WXWIN_OS_DESCRIPTION
, "%255s %d.%d", name
, &major
, &minor
) != 3 )
98 // unreckognized uname string format