2015-03-16 03:13:42 -03:00
|
|
|
#ifndef HEADER_FreeBSDProcess
|
|
|
|
#define HEADER_FreeBSDProcess
|
|
|
|
/*
|
|
|
|
htop - FreeBSDProcess.h
|
|
|
|
(C) 2015 Hisham H. Muhammad
|
2020-10-05 09:51:32 +02:00
|
|
|
Released under the GNU GPLv2, see the COPYING file
|
2015-03-16 03:13:42 -03:00
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
2020-09-19 13:55:23 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "Object.h"
|
|
|
|
#include "Process.h"
|
|
|
|
#include "Settings.h"
|
|
|
|
|
|
|
|
|
2020-10-21 13:56:26 +02:00
|
|
|
#define PROCESS_FLAG_FREEBSD_TTY 0x0100
|
|
|
|
|
|
|
|
extern const char* const nodevStr;
|
|
|
|
|
2015-03-16 03:13:42 -03:00
|
|
|
typedef struct FreeBSDProcess_ {
|
|
|
|
Process super;
|
2015-10-19 17:22:54 -02:00
|
|
|
int kernel;
|
|
|
|
int jid;
|
|
|
|
char* jname;
|
2020-10-21 13:56:26 +02:00
|
|
|
const char* ttyPath;
|
2015-03-16 03:13:42 -03:00
|
|
|
} FreeBSDProcess;
|
|
|
|
|
2020-10-21 19:11:26 +02:00
|
|
|
static inline bool Process_isKernelThread(const Process* this) {
|
|
|
|
return ((const FreeBSDProcess*)this)->kernel == 1;
|
|
|
|
}
|
2015-03-16 23:01:48 -03:00
|
|
|
|
2020-10-21 19:11:26 +02:00
|
|
|
static inline bool Process_isUserlandThread(const Process* this) {
|
|
|
|
return this->pid != this->tgid;
|
|
|
|
}
|
2015-03-16 03:13:42 -03:00
|
|
|
|
2020-10-13 14:35:30 +02:00
|
|
|
extern const ProcessClass FreeBSDProcess_class;
|
2015-06-07 17:17:46 +08:00
|
|
|
|
2020-12-15 19:44:52 +01:00
|
|
|
extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
|
2015-03-16 03:13:42 -03:00
|
|
|
|
2020-10-21 21:26:05 +02:00
|
|
|
Process* FreeBSDProcess_new(const Settings* settings);
|
2015-03-16 03:13:42 -03:00
|
|
|
|
|
|
|
void Process_delete(Object* cast);
|
|
|
|
|
2020-10-07 19:02:15 +02:00
|
|
|
bool Process_isThread(const Process* this);
|
2015-03-16 03:13:42 -03:00
|
|
|
|
|
|
|
#endif
|