Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
9710a430
Commit
9710a430
authored
May 17, 2007
by
Hisham Muhammad
Browse files
Fixes for /proc location, submitted by Florent Thoumie
parent
df20abfd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
9710a430
...
...
@@ -28,7 +28,9 @@ in the source distribution for its full text.
// This works only with glibc 2.1+. On earlier versions
// the behavior is similar to have a hardcoded page size.
#ifndef PAGE_SIZE
#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) / 1024 )
#endif
#define PROCESS_COMM_LEN 300
...
...
Process.h
View file @
9710a430
...
...
@@ -31,7 +31,9 @@ in the source distribution for its full text.
// This works only with glibc 2.1+. On earlier versions
// the behavior is similar to have a hardcoded page size.
#ifndef PAGE_SIZE
#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) / 1024 )
#endif
#define PROCESS_COMM_LEN 300
...
...
@@ -52,16 +54,16 @@ typedef struct Process_ {
struct
ProcessList_
*
pl
;
bool
updated
;
int
pid
;
unsigned
int
pid
;
char
*
comm
;
int
indent
;
char
state
;
bool
tag
;
int
ppid
;
int
pgrp
;
int
session
;
int
tty_nr
;
int
tpgid
;
unsigned
int
ppid
;
unsigned
int
pgrp
;
unsigned
int
session
;
unsigned
int
tty_nr
;
unsigned
int
tpgid
;
unsigned
long
int
flags
;
#ifdef DEBUG
unsigned
long
int
minflt
;
...
...
ProcessList.c
View file @
9710a430
...
...
@@ -37,11 +37,11 @@ in the source distribution for its full text.
#endif
#ifndef PROCSTATFILE
#define PROCSTATFILE
"/proc
/stat"
#define PROCSTATFILE
PROCDIR "
/stat"
#endif
#ifndef PROCMEMINFOFILE
#define PROCMEMINFOFILE
"/proc
/meminfo"
#define PROCMEMINFOFILE
PROCDIR "
/meminfo"
#endif
#ifndef MAX_NAME
...
...
@@ -426,7 +426,7 @@ static int ProcessList_readStatFile(ProcessList* this, Process *proc, FILE *f, c
#else
long
int
uzero
;
int
num
=
ProcessList_read
(
this
,
location
,
"%c %
d
%
d
%
d
%
d
%
d
%lu %lu %lu %lu "
"%c %
u
%
u
%
u
%
u
%
u
%lu %lu %lu %lu "
"%lu %lu %lu %ld %ld %ld %ld %ld %ld "
"%lu %lu %ld %lu %lu %lu %lu %lu "
"%lu %lu %lu %lu %lu %lu %lu %lu "
...
...
ProcessList.h
View file @
9710a430
...
...
@@ -39,11 +39,11 @@ in the source distribution for its full text.
#endif
#ifndef PROCSTATFILE
#define PROCSTATFILE
"/proc
/stat"
#define PROCSTATFILE
PROCDIR "
/stat"
#endif
#ifndef PROCMEMINFOFILE
#define PROCMEMINFOFILE
"/proc
/meminfo"
#define PROCMEMINFOFILE
PROCDIR "
/meminfo"
#endif
#ifndef MAX_NAME
...
...
scripts/MakeHeader.py
View file @
9710a430
...
...
@@ -21,6 +21,8 @@ class writer:
self
.
file
.
write
(
text
+
"
\n
"
)
out
=
writer
(
out
)
print
(
"Generating "
+
name
+
".h"
)
selfheader
=
'#include "'
+
name
+
'.h"'
out
.
write
(
"/* Do not edit this file. It was automatically generated. */"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment