diff options
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h index fcff7b51e..7c0ff9de0 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -3,9 +3,9 @@ | |||
3 | * Busybox main internal header file | 3 | * Busybox main internal header file |
4 | * | 4 | * |
5 | * Based in part on code from sash, Copyright (c) 1999 by David I. Bell | 5 | * Based in part on code from sash, Copyright (c) 1999 by David I. Bell |
6 | * Permission has been granted to redistribute this code under the GPL. | 6 | * Permission has been granted to redistribute this code under GPL. |
7 | * | 7 | * |
8 | * Licensed under the GPL version 2, see the file LICENSE in this tarball. | 8 | * Licensed under GPLv2, see file LICENSE in this source tree. |
9 | */ | 9 | */ |
10 | #ifndef LIBBB_H | 10 | #ifndef LIBBB_H |
11 | #define LIBBB_H 1 | 11 | #define LIBBB_H 1 |
@@ -422,12 +422,14 @@ void bb_unsetenv(const char *key) FAST_FUNC; | |||
422 | void bb_unsetenv_and_free(char *key) FAST_FUNC; | 422 | void bb_unsetenv_and_free(char *key) FAST_FUNC; |
423 | void xunlink(const char *pathname) FAST_FUNC; | 423 | void xunlink(const char *pathname) FAST_FUNC; |
424 | void xstat(const char *pathname, struct stat *buf) FAST_FUNC; | 424 | void xstat(const char *pathname, struct stat *buf) FAST_FUNC; |
425 | void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; | ||
425 | int xopen(const char *pathname, int flags) FAST_FUNC; | 426 | int xopen(const char *pathname, int flags) FAST_FUNC; |
426 | int xopen_nonblocking(const char *pathname) FAST_FUNC; | 427 | int xopen_nonblocking(const char *pathname) FAST_FUNC; |
427 | int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; | 428 | int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; |
428 | int open_or_warn(const char *pathname, int flags) FAST_FUNC; | 429 | int open_or_warn(const char *pathname, int flags) FAST_FUNC; |
429 | int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; | 430 | int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; |
430 | int open_or_warn_stdin(const char *pathname) FAST_FUNC; | 431 | int open_or_warn_stdin(const char *pathname) FAST_FUNC; |
432 | int xopen_stdin(const char *pathname) FAST_FUNC; | ||
431 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; | 433 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; |
432 | int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC; | 434 | int rename_or_warn(const char *oldpath, const char *newpath) FAST_FUNC; |
433 | off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC; | 435 | off_t xlseek(int fd, off_t offset, int whence) FAST_FUNC; |
@@ -1402,6 +1404,29 @@ enum { COMM_LEN = TASK_COMM_LEN }; | |||
1402 | enum { COMM_LEN = 16 }; | 1404 | enum { COMM_LEN = 16 }; |
1403 | # endif | 1405 | # endif |
1404 | #endif | 1406 | #endif |
1407 | |||
1408 | struct smaprec { | ||
1409 | unsigned long mapped_rw; | ||
1410 | unsigned long mapped_ro; | ||
1411 | unsigned long shared_clean; | ||
1412 | unsigned long shared_dirty; | ||
1413 | unsigned long private_clean; | ||
1414 | unsigned long private_dirty; | ||
1415 | unsigned long stack; | ||
1416 | unsigned long smap_pss, smap_swap; | ||
1417 | unsigned long smap_size; | ||
1418 | unsigned long smap_start; | ||
1419 | char smap_mode[5]; | ||
1420 | char *smap_name; | ||
1421 | }; | ||
1422 | |||
1423 | #if !ENABLE_PMAP | ||
1424 | #define procps_read_smaps(pid, total, cb, data) \ | ||
1425 | procps_read_smaps(pid, total) | ||
1426 | #endif | ||
1427 | int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, | ||
1428 | void (*cb)(struct smaprec *, void *), void *data); | ||
1429 | |||
1405 | typedef struct procps_status_t { | 1430 | typedef struct procps_status_t { |
1406 | DIR *dir; | 1431 | DIR *dir; |
1407 | IF_FEATURE_SHOW_THREADS(DIR *task_dir;) | 1432 | IF_FEATURE_SHOW_THREADS(DIR *task_dir;) |
@@ -1430,13 +1455,7 @@ typedef struct procps_status_t { | |||
1430 | #endif | 1455 | #endif |
1431 | unsigned tty_major,tty_minor; | 1456 | unsigned tty_major,tty_minor; |
1432 | #if ENABLE_FEATURE_TOPMEM | 1457 | #if ENABLE_FEATURE_TOPMEM |
1433 | unsigned long mapped_rw; | 1458 | struct smaprec smaps; |
1434 | unsigned long mapped_ro; | ||
1435 | unsigned long shared_clean; | ||
1436 | unsigned long shared_dirty; | ||
1437 | unsigned long private_clean; | ||
1438 | unsigned long private_dirty; | ||
1439 | unsigned long stack; | ||
1440 | #endif | 1459 | #endif |
1441 | char state[4]; | 1460 | char state[4]; |
1442 | /* basename of executable in exec(2), read from /proc/N/stat | 1461 | /* basename of executable in exec(2), read from /proc/N/stat |