diff options
author | Ron Yorston <rmy@pobox.com> | 2019-01-08 15:51:04 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-01-08 15:51:04 +0000 |
commit | bade8b3460ea3cf1182cd1bda9faf8b6ccee6a25 (patch) | |
tree | 6b0c855e3d0688e07f512e61d17d76d09c64c6cb /include | |
parent | 59701e7f6a483d4aad4dc7088c673cd69fe294c8 (diff) | |
download | busybox-w32-bade8b3460ea3cf1182cd1bda9faf8b6ccee6a25.tar.gz busybox-w32-bade8b3460ea3cf1182cd1bda9faf8b6ccee6a25.tar.bz2 busybox-w32-bade8b3460ea3cf1182cd1bda9faf8b6ccee6a25.zip |
ps: add support for the args column
Implement read_cmdline() for WIN32 by storing the command line in
the same way as the applet name.
The applet name is actually used for the comm column which is
truncated to COMM_LEN. Using this as the size of the bb_comm
array avoids the need to calculate MAX_APPLET_NAME_LEN.
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h index 8b18782c8..dc1c81865 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1969,11 +1969,7 @@ void free_procps_scan(procps_status_t* sp) FAST_FUNC; | |||
1969 | procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; | 1969 | procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; |
1970 | /* Format cmdline (up to col chars) into char buf[size] */ | 1970 | /* Format cmdline (up to col chars) into char buf[size] */ |
1971 | /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ | 1971 | /* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ |
1972 | #if !ENABLE_PLATFORM_MINGW32 | ||
1973 | void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC; | 1972 | void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC; |
1974 | #else | ||
1975 | #define read_cmdline(buf, size, pid, comm) snprintf(buf, size, "[%s]", comm) | ||
1976 | #endif | ||
1977 | pid_t *find_pid_by_name(const char* procName) FAST_FUNC; | 1973 | pid_t *find_pid_by_name(const char* procName) FAST_FUNC; |
1978 | pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC; | 1974 | pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC; |
1979 | int starts_with_cpu(const char *str) FAST_FUNC; | 1975 | int starts_with_cpu(const char *str) FAST_FUNC; |
@@ -2122,7 +2118,8 @@ extern const char bb_path_wtmp_file[] ALIGN1; | |||
2122 | #define bb_dev_null "/dev/null" | 2118 | #define bb_dev_null "/dev/null" |
2123 | #if ENABLE_PLATFORM_MINGW32 | 2119 | #if ENABLE_PLATFORM_MINGW32 |
2124 | #define bb_busybox_exec_path get_busybox_exec_path() | 2120 | #define bb_busybox_exec_path get_busybox_exec_path() |
2125 | extern char bb_applet_name[]; | 2121 | extern char bb_comm[]; |
2122 | extern char bb_command_line[]; | ||
2126 | #else | 2123 | #else |
2127 | extern const char bb_busybox_exec_path[] ALIGN1; | 2124 | extern const char bb_busybox_exec_path[] ALIGN1; |
2128 | #endif | 2125 | #endif |