FreeNOS
ProcessClient.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIB_LIBRUNTIME_PROCESSCLIENT_H
19#define __LIB_LIBRUNTIME_PROCESSCLIENT_H
20
21#include <FreeNOS/User.h>
22#include <FreeNOS/ProcessManager.h>
23#include <Types.h>
24#include <String.h>
25
40{
41 public:
42
45
55
71
72 public:
73
79 ProcessID getProcessID() const;
80
86 ProcessID getParentID() const;
87
96 Result processInfo(const ProcessID pid, Info &info) const;
97
109 Result processInfo(const String program, Info &info) const;
110
122 ProcessID findProcess(const String program) const;
123
124 private:
125
127 static const ProcessID m_pid;
128
130 static const ProcessID m_parent;
131};
132
138#endif /* __LIB_LIBRUNTIME_PROCESSCLIENT_H */
ProcessClient provides information about all processes on the local core.
struct ProcessClient::Info Info
Process information.
static const Size MaximumProcesses
Maximum number of processes.
static const ProcessID m_parent
Our parent process identifier.
Result
Result codes.
ProcessID findProcess(const String program) const
Find a process by its program name.
ProcessID getProcessID() const
Get current process identifier.
static const ProcessID m_pid
Our own process identifier.
ProcessID getParentID() const
Get parent process identifier.
Result processInfo(const ProcessID pid, Info &info) const
Get process information by its ID.
Abstraction of strings.
Definition String.h:42
#define MAX_PROCS
Maximum number of processes.
u32 ProcessID
Process Identification Number.
Definition Types.h:140
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Process information.
String command
Full command including program path.
ProcessInfo kernelState
Process state retrieved from the kernel.
String textState
Textual state of the process.
Process information structure, used for Info.
Definition ProcessCtl.h:64