wibble 1.1
process.h
Go to the documentation of this file.
1#ifndef WIBBLE_SYS_PROCESS_H
2#define WIBBLE_SYS_PROCESS_H
3
4/*
5 * OO base class for process functions and child processes
6 *
7 * Copyright (C) 2003--2010 Enrico Zini <enrico@debian.org>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#include <wibble/sys/macros.h>
25#include <wibble/exception.h>
26
27#include <sys/types.h>
28
29namespace wibble {
30namespace sys {
31namespace process {
32
34std::string getcwd();
35
36#ifdef POSIX
37
39std::string formatStatus(int status);
40
42void chdir(const std::string& dir);
43
45void chroot(const std::string& dir);
46
48mode_t umask(mode_t mask);
49
51void setPerms(const std::string& user);
52void setPerms(const std::string& user, const std::string& group);
53void setPerms(uid_t user);
54void setPerms(uid_t user, gid_t group);
55
58int getCPUTimeLimit(int* max = 0);
59int getFileSizeLimit(int* max = 0);
60int getDataMemoryLimit(int* max = 0);
61int getChildrenLimit(int* max = 0);
62int getOpenFilesLimit(int* max = 0);
63int getCoreSizeLimit(int* max = 0);
64
66void setCPUTimeLimit(int value);
67void setFileSizeLimit(int value);
68void setDataMemoryLimit(int value);
69void setChildrenLimit(int value);
70void setOpenFilesLimit(int value);
71void setCoreSizeLimit(int value);
72
74void detachFromTTY();
75
82void initproctitle(int argc, char **argv);
83
90void setproctitle(const std::string& title);
91#endif
92
93}
94}
95}
96
97// vim:set ts=4 sw=4:
98#endif
std::string getcwd()
Get the absolute path of the current working directory.
Definition amorph.h:17
Definition amorph.h:30