/usr/include/wibble/sys/process.h is in libwibble-dev 1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | #ifndef WIBBLE_SYS_PROCESS_H
#define WIBBLE_SYS_PROCESS_H
/*
* OO base class for process functions and child processes
*
* Copyright (C) 2003--2010 Enrico Zini <enrico@debian.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <wibble/sys/macros.h>
#include <wibble/exception.h>
#include <sys/types.h>
namespace wibble {
namespace sys {
namespace process {
/// Get the absolute path of the current working directory
std::string getcwd();
#ifdef POSIX
/// Pretty-print the return value of a process into a string
std::string formatStatus(int status);
/// Change working directory
void chdir(const std::string& dir);
/// Change root directory
void chroot(const std::string& dir);
/// Change umask (always succeeds and returns the previous umask)
mode_t umask(mode_t mask);
/// Set user and group permissions
void setPerms(const std::string& user);
void setPerms(const std::string& user, const std::string& group);
void setPerms(uid_t user);
void setPerms(uid_t user, gid_t group);
/// Get current resource limits; store also maximum resource limits in max
/// if nonzero
int getCPUTimeLimit(int* max = 0);
int getFileSizeLimit(int* max = 0);
int getDataMemoryLimit(int* max = 0);
int getChildrenLimit(int* max = 0);
int getOpenFilesLimit(int* max = 0);
int getCoreSizeLimit(int* max = 0);
/// Set resource limits
void setCPUTimeLimit(int value);
void setFileSizeLimit(int value);
void setDataMemoryLimit(int value);
void setChildrenLimit(int value);
void setOpenFilesLimit(int value);
void setCoreSizeLimit(int value);
/// Close stdin, stdout and stderr and detach from the tty
void detachFromTTY();
/**
* Call from main() if you intend to set a different process title later on
*
* On Linux, this function moves the environment to a different location to
* allow its memory to be reused for the process title
*/
void initproctitle(int argc, char **argv);
/**
* Change the process title, overwriting the contents of argv
*
* This is currently only implemented for Linux: on other systems it does not
* do anything.
*/
void setproctitle(const std::string& title);
#endif
}
}
}
// vim:set ts=4 sw=4:
#endif
|