oom_score_adj.h
Go to the documentation of this file.
/*
* Copyright © 2012-2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef CORE_POSIX_LINUX_PROC_PROCESS_OOM_SCORE_ADJ_H_
#define CORE_POSIX_LINUX_PROC_PROCESS_OOM_SCORE_ADJ_H_
#include <core/posix/visibility.h>
namespace core
{
namespace posix
{
class Process;
namespace linux
{
namespace proc
{
namespace process
{
struct CORE_POSIX_DLL_PUBLIC OomScoreAdj
{
static int min_value();
static int max_value();
inline bool is_valid() const
{
return (min_value() <= value) && (value <= max_value());
}
int value;
};
CORE_POSIX_DLL_PUBLIC const posix::Process& operator>>(const posix::Process& process, OomScoreAdj& score_adj);
CORE_POSIX_DLL_PUBLIC const posix::Process& operator<<(const posix::Process& process,
const OomScoreAdj& score_adj);
}
}
}
}
}
#endif // CORE_POSIX_LINUX_PROC_PROCESS_OOM_SCORE_ADJ_H_
core::posix::Process
The Process class models a process and possible operations on it.
Definition: process.h:45
core::posix::linux::proc::process::operator>>
CORE_POSIX_DLL_PUBLIC const posix::Process & operator>>(const posix::Process &process, OomAdj &adj)
Read the OomAdj value for a process instance.
Definition: oom_adj.cpp:55
core::posix::linux::proc::process::operator<<
CORE_POSIX_DLL_PUBLIC const posix::Process & operator<<(const posix::Process &process, const OomAdj &adj)
Write the OomAdj value for a process instance.
Definition: oom_adj.cpp:65
core
Definition: child_process.h:32
core::posix::linux::proc::process::OomScoreAdj
Definition: oom_score_adj.h:82
core::posix::linux::proc::process::OomScoreAdj::value
int value
Current value.
Definition: oom_score_adj.h:107
core::posix::linux::proc::process::OomScoreAdj::is_valid
bool is_valid() const
is_valid checks whether the contained value is within the predefined bounds.
Definition: oom_score_adj.h:99
visibility.h
CORE_POSIX_DLL_PUBLIC
#define CORE_POSIX_DLL_PUBLIC
Definition: visibility.h:26