2015-03-16 06:13:42 +00:00
|
|
|
#ifndef HEADER_FreeBSDProcess
|
|
|
|
#define HEADER_FreeBSDProcess
|
|
|
|
/*
|
|
|
|
htop - FreeBSDProcess.h
|
|
|
|
(C) 2015 Hisham H. Muhammad
|
|
|
|
Released under the GNU GPL, see the COPYING file
|
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum FreeBSDProcessFields {
|
|
|
|
// Add platform-specific fields here, with ids >= 100
|
2015-10-19 19:22:54 +00:00
|
|
|
JID = 100,
|
|
|
|
JAIL = 101,
|
|
|
|
LAST_PROCESSFIELD = 102,
|
2015-03-16 06:13:42 +00:00
|
|
|
} FreeBSDProcessField;
|
|
|
|
|
2015-10-19 19:22:54 +00:00
|
|
|
|
2015-03-16 06:13:42 +00:00
|
|
|
typedef struct FreeBSDProcess_ {
|
|
|
|
Process super;
|
2015-10-19 19:22:54 +00:00
|
|
|
int kernel;
|
|
|
|
int jid;
|
|
|
|
char* jname;
|
2015-03-16 06:13:42 +00:00
|
|
|
} FreeBSDProcess;
|
|
|
|
|
2015-10-19 19:22:54 +00:00
|
|
|
|
2015-03-17 02:01:48 +00:00
|
|
|
#ifndef Process_isKernelThread
|
2015-10-19 19:22:54 +00:00
|
|
|
#define Process_isKernelThread(_process) (_process->kernel == 1)
|
2015-03-17 02:01:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef Process_isUserlandThread
|
|
|
|
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
|
|
|
|
#endif
|
|
|
|
|
2015-03-16 06:13:42 +00:00
|
|
|
|
2015-06-07 09:17:46 +00:00
|
|
|
extern ProcessClass FreeBSDProcess_class;
|
|
|
|
|
2015-03-16 06:13:42 +00:00
|
|
|
extern ProcessFieldData Process_fields[];
|
|
|
|
|
2015-10-19 19:22:54 +00:00
|
|
|
extern ProcessPidColumn Process_pidColumns[];
|
2015-03-16 06:13:42 +00:00
|
|
|
|
|
|
|
FreeBSDProcess* FreeBSDProcess_new(Settings* settings);
|
|
|
|
|
|
|
|
void Process_delete(Object* cast);
|
|
|
|
|
2015-06-07 09:17:46 +00:00
|
|
|
void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field);
|
2015-03-16 06:13:42 +00:00
|
|
|
|
2015-06-07 09:17:46 +00:00
|
|
|
long FreeBSDProcess_compare(const void* v1, const void* v2);
|
2015-03-16 06:13:42 +00:00
|
|
|
|
|
|
|
bool Process_isThread(Process* this);
|
|
|
|
|
|
|
|
#endif
|