| alloc.h | | alloc.h | |
| #ifndef PROCPS_PROC_ALLOC_H | | #ifndef PROCPS_PROC_ALLOC_H | |
| #define PROCPS_PROC_ALLOC_H | | #define PROCPS_PROC_ALLOC_H | |
| | | | |
| #include "procps.h" | | #include "procps.h" | |
| | | | |
| EXTERN_C_BEGIN | | EXTERN_C_BEGIN | |
| | | | |
|
| extern void *xrealloc(void *oldp, unsigned int size) MALLOC; | | /* change xalloc_err_handler to override the default fprintf(stderr... */ | |
| | | extern message_fn xalloc_err_handler; | |
| | | | |
| | | extern void *xcalloc(unsigned int size) MALLOC; | |
| extern void *xmalloc(unsigned int size) MALLOC; | | extern void *xmalloc(unsigned int size) MALLOC; | |
|
| extern void *xcalloc(void *pointer, int size) MALLOC; | | extern void *xrealloc(void *oldp, unsigned int size) MALLOC; | |
| | | extern char *xstrdup(const char *str) MALLOC; | |
| | | | |
| EXTERN_C_END | | EXTERN_C_END | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 6 lines changed or added | |
|
| devname.h | | devname.h | |
| #ifndef PROC_DEVNAME_H | | #ifndef PROC_DEVNAME_H | |
| #define PROC_DEVNAME_H | | #define PROC_DEVNAME_H | |
| | | | |
| #include "procps.h" | | #include "procps.h" | |
|
| | | #include "readproc.h" | |
| | | | |
| EXTERN_C_BEGIN | | EXTERN_C_BEGIN | |
| | | | |
| #define ABBREV_DEV 1 /* remove /dev/ */ | | #define ABBREV_DEV 1 /* remove /dev/ */ | |
| #define ABBREV_TTY 2 /* remove tty */ | | #define ABBREV_TTY 2 /* remove tty */ | |
| #define ABBREV_PTS 4 /* remove pts/ */ | | #define ABBREV_PTS 4 /* remove pts/ */ | |
| | | | |
| extern unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_d
ev, int pid, unsigned int flags); | | extern unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_d
ev, int pid, unsigned int flags); | |
| | | | |
| extern int tty_to_dev(const char *restrict const name); | | extern int tty_to_dev(const char *restrict const name); | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 1 lines changed or added | |
|
| escape.h | | escape.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| #include "readproc.h" | | #include "readproc.h" | |
| | | | |
| EXTERN_C_BEGIN | | EXTERN_C_BEGIN | |
| | | | |
| #define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for
octal escapes) | | #define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for
octal escapes) | |
| | | | |
| #define ESC_ARGS 0x1 // try to use cmdline instead of cmd | | #define ESC_ARGS 0x1 // try to use cmdline instead of cmd | |
| #define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it | | #define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it | |
| #define ESC_DEFUNCT 0x4 // mark zombies with " <defunct>" | | #define ESC_DEFUNCT 0x4 // mark zombies with " <defunct>" | |
| | | | |
|
| extern int escape_strlist(char *restrict dst, const char *restrict const *r
estrict src, size_t n, int *cells); | | extern int escape_strlist(char *restrict dst, char *restrict const *restric
t src, size_t n, int *cells); | |
| extern int escape_str(char *restrict dst, const char *restrict src, int buf
size, int *maxcells); | | extern int escape_str(char *restrict dst, const char *restrict src, int buf
size, int *maxcells); | |
| extern int escape_command(char *restrict const outbuf, const proc_t *restri
ct const pp, int bytes, int *cells, unsigned flags); | | extern int escape_command(char *restrict const outbuf, const proc_t *restri
ct const pp, int bytes, int *cells, unsigned flags); | |
| extern int escaped_copy(char *restrict dst, const char *restrict src, int b
ufsize, int *maxroom); | | extern int escaped_copy(char *restrict dst, const char *restrict src, int b
ufsize, int *maxroom); | |
| | | | |
| EXTERN_C_END | | EXTERN_C_END | |
| #endif | | #endif | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|
| procps.h | | procps.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| #else | | #else | |
| #define KLONG long | | #define KLONG long | |
| #define KLF "l" | | #define KLF "l" | |
| #define STRTOUKL strtoul | | #define STRTOUKL strtoul | |
| #endif | | #endif | |
| | | | |
| // since gcc-2.5 | | // since gcc-2.5 | |
| #define NORETURN __attribute__((__noreturn__)) | | #define NORETURN __attribute__((__noreturn__)) | |
| #define FUNCTION __attribute__((__const__)) // no access to global mem, ev
en via ptr, and no side effect | | #define FUNCTION __attribute__((__const__)) // no access to global mem, ev
en via ptr, and no side effect | |
| | | | |
|
| #if !defined(restrict) && __STDC_VERSION__ < 199901 | | | |
| #if __GNUC__ > 2 || __GNUC_MINOR__ >= 92 | | | |
| #define restrict __restrict__ | | | |
| #else | | | |
| #warning No restrict keyword? | | | |
| #define restrict | | | |
| #endif | | | |
| #endif | | | |
| | | | |
| #if __GNUC__ > 2 || __GNUC_MINOR__ >= 96 | | #if __GNUC__ > 2 || __GNUC_MINOR__ >= 96 | |
| // won't alias anything, and aligned enough for anything | | // won't alias anything, and aligned enough for anything | |
| #define MALLOC __attribute__ ((__malloc__)) | | #define MALLOC __attribute__ ((__malloc__)) | |
| // no side effect, may read globals | | // no side effect, may read globals | |
| #define PURE __attribute__ ((__pure__)) | | #define PURE __attribute__ ((__pure__)) | |
| // tell gcc what to expect: if(unlikely(err)) die(err); | | // tell gcc what to expect: if(unlikely(err)) die(err); | |
| #define likely(x) __builtin_expect(!!(x),1) | | #define likely(x) __builtin_expect(!!(x),1) | |
| #define unlikely(x) __builtin_expect(!!(x),0) | | #define unlikely(x) __builtin_expect(!!(x),0) | |
| #define expected(x,y) __builtin_expect((x),(y)) | | #define expected(x,y) __builtin_expect((x),(y)) | |
| #else | | #else | |
| #define MALLOC | | #define MALLOC | |
| #define PURE | | #define PURE | |
| #define likely(x) (x) | | #define likely(x) (x) | |
| #define unlikely(x) (x) | | #define unlikely(x) (x) | |
| #define expected(x,y) (x) | | #define expected(x,y) (x) | |
| #endif | | #endif | |
| | | | |
|
| #if SHARED==1 && (__GNUC__ > 2 || __GNUC_MINOR__ >= 96) | | #ifdef SHARED | |
| #define LABEL_OFFSET | | # if SHARED==1 && (__GNUC__ > 2 || __GNUC_MINOR__ >= 96) | |
| | | # define LABEL_OFFSET | |
| | | # endif | |
| #endif | | #endif | |
| | | | |
| #define STRINGIFY_ARG(a) #a | | #define STRINGIFY_ARG(a) #a | |
| #define STRINGIFY(a) STRINGIFY_ARG(a) | | #define STRINGIFY(a) STRINGIFY_ARG(a) | |
| | | | |
| // marks old junk, to warn non-procps-ng library users | | // marks old junk, to warn non-procps-ng library users | |
| #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | | #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | |
| #define OBSOLETE __attribute__((deprecated)) | | #define OBSOLETE __attribute__((deprecated)) | |
| #else | | #else | |
| #define OBSOLETE | | #define OBSOLETE | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 105 | |
| | | | |
| // Like HIDDEN, but for an alias that gets created. | | // Like HIDDEN, but for an alias that gets created. | |
| // In gcc-3.2 there is an alias+hidden conflict. | | // In gcc-3.2 there is an alias+hidden conflict. | |
| // Many will have patched this bug, but oh well. | | // Many will have patched this bug, but oh well. | |
| #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 2 ) || __GNUC__ > 3 | | #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 2 ) || __GNUC__ > 3 | |
| #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias(
#x),visibility("hidden"))) | | #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias(
#x),visibility("hidden"))) | |
| #else | | #else | |
| #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias(
#x))) | | #define HIDDEN_ALIAS(x) extern __typeof(x) x##_direct __attribute__((alias(
#x))) | |
| #endif | | #endif | |
| | | | |
|
| | | typedef void (*message_fn)(const char *restrict, ...) __attribute__((format | |
| | | (printf,1,2))); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 11 lines changed or deleted | | 7 lines changed or added | |
|
| readproc.h | | readproc.h | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 143 | |
| cmd[16]; // stat,status basename of executable file in ca
ll to exec(2) | | cmd[16]; // stat,status basename of executable file in ca
ll to exec(2) | |
| struct proc_t | | struct proc_t | |
| *ring, // n/a thread group ring | | *ring, // n/a thread group ring | |
| *next; // n/a various library uses | | *next; // n/a various library uses | |
| int | | int | |
| pgrp, // stat process group id | | pgrp, // stat process group id | |
| session, // stat session id | | session, // stat session id | |
| nlwp, // stat,status number of threads, or 0 if no clu
e | | nlwp, // stat,status number of threads, or 0 if no clu
e | |
| tgid, // (special) thread group ID, the POSIX PID (s
ee also: tid) | | tgid, // (special) thread group ID, the POSIX PID (s
ee also: tid) | |
| tty, // stat full device number of controlling
terminal | | tty, // stat full device number of controlling
terminal | |
|
| | | /* FIXME: int uids & gids should be uid_t or gid_t from pwd.h */ | |
| euid, egid, // stat(),status effective | | euid, egid, // stat(),status effective | |
| ruid, rgid, // status real | | ruid, rgid, // status real | |
| suid, sgid, // status saved | | suid, sgid, // status saved | |
| fuid, fgid, // status fs (used for file access only) | | fuid, fgid, // status fs (used for file access only) | |
| tpgid, // stat terminal process group id | | tpgid, // stat terminal process group id | |
| exit_signal, // stat might not be SIGCHLD | | exit_signal, // stat might not be SIGCHLD | |
| processor; // stat current (or most recent?) CPU | | processor; // stat current (or most recent?) CPU | |
| #ifdef OOMEM_ENABLE | | #ifdef OOMEM_ENABLE | |
| int | | int | |
| oom_score, // oom_score (badness for OOM killer) | | oom_score, // oom_score (badness for OOM killer) | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 1 lines changed or added | |
|
| sig.h | | sig.h | |
| | | | |
| skipping to change at line 25 | | skipping to change at line 25 | |
| | | | |
| EXTERN_C_BEGIN | | EXTERN_C_BEGIN | |
| | | | |
| /* return -1 on failure */ | | /* return -1 on failure */ | |
| extern int signal_name_to_number(const char *restrict name); | | extern int signal_name_to_number(const char *restrict name); | |
| | | | |
| extern const char *signal_number_to_name(int signo); | | extern const char *signal_number_to_name(int signo); | |
| | | | |
| extern int print_given_signals(int argc, const char *restrict const *restri
ct argv, int max_line); | | extern int print_given_signals(int argc, const char *restrict const *restri
ct argv, int max_line); | |
| | | | |
|
| | | extern char *strtosig(const char *restrict s); | |
| | | | |
| extern void pretty_print_signals(void); | | extern void pretty_print_signals(void); | |
| | | | |
| extern void unix_print_signals(void); | | extern void unix_print_signals(void); | |
| | | | |
| EXTERN_C_END | | EXTERN_C_END | |
| #endif | | #endif | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 2 lines changed or added | |
|