00001 #ifndef WIBBLE_SYS_PROCESS_H 00002 #define WIBBLE_SYS_PROCESS_H 00003 00004 /* 00005 * OO base class for process functions and child processes 00006 * 00007 * Copyright (C) 2003--2006 Enrico Zini <enrico@debian.org> 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 #include <wibble/exception.h> 00025 #include <sys/types.h> 00026 00027 namespace wibble { 00028 namespace sys { 00029 namespace process { 00030 00032 std::string formatStatus(int status); 00033 00035 void chdir(const std::string& dir); 00036 00038 std::string getcwd(); 00039 00041 void chroot(const std::string& dir); 00042 00044 mode_t umask(mode_t mask); 00045 00047 void setPerms(const std::string& user); 00048 void setPerms(const std::string& user, const std::string& group); 00049 void setPerms(uid_t user); 00050 void setPerms(uid_t user, gid_t group); 00051 00054 int getCPUTimeLimit(int* max = 0); 00055 int getFileSizeLimit(int* max = 0); 00056 int getDataMemoryLimit(int* max = 0); 00057 int getChildrenLimit(int* max = 0); 00058 int getOpenFilesLimit(int* max = 0); 00059 int getCoreSizeLimit(int* max = 0); 00060 00062 void setCPUTimeLimit(int value); 00063 void setFileSizeLimit(int value); 00064 void setDataMemoryLimit(int value); 00065 void setChildrenLimit(int value); 00066 void setOpenFilesLimit(int value); 00067 void setCoreSizeLimit(int value); 00068 00070 void detachFromTTY(); 00071 00072 } 00073 } 00074 } 00075 00076 // vim:set ts=4 sw=4: 00077 #endif