]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Applied patch [ 571965 ] update stc contrib stuff
[wxWidgets.git] / src / unix / utilsunx.cpp
index b372b21c34402fe372f897f567f8cd9014ae2828..a455399ffdb9a7cb6890ca4c0ac274ee311d3ab4 100644 (file)
@@ -290,6 +290,29 @@ bool wxShell(const wxString& command, wxArrayString& output)
     return wxExecute(wxMakeShellCommand(command), output);
 }
 
+// Shutdown or reboot the PC
+bool wxShutdown(wxShutdownFlags wFlags)
+{
+    wxChar level;
+    switch ( wFlags )
+    {
+        case wxSHUTDOWN_POWEROFF:
+            level = _T('0');
+            break;
+
+        case wxSHUTDOWN_REBOOT:
+            level = _T('6');
+            break;
+
+        default:
+            wxFAIL_MSG( _T("unknown wxShutdown() flag") );
+            return FALSE;
+    }
+
+    return system(wxString::Format(_T("init %c"), level).mb_str()) == 0;
+}
+
+
 #if wxUSE_GUI
 
 void wxHandleProcessTermination(wxEndProcessData *proc_data)
@@ -995,6 +1018,11 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 
 #endif // !wxUSE_GUI
 
+unsigned long wxGetProcessId()
+{
+    return (unsigned long)getpid();
+}
+
 long wxGetFreeMemory()
 {
 #if defined(__LINUX__)