summaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 68a7cf002..2850b1d5a 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -112,6 +112,13 @@
112# include <arpa/inet.h> 112# include <arpa/inet.h>
113#elif defined __APPLE__ 113#elif defined __APPLE__
114# include <netinet/in.h> 114# include <netinet/in.h>
115#elif ENABLE_PLATFORM_MINGW32
116# ifndef WINVER
117# define WINVER 0x0501
118# endif
119# include <winsock2.h>
120# include <ws2tcpip.h>
121# undef s_addr
115#else 122#else
116# include <arpa/inet.h> 123# include <arpa/inet.h>
117# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) 124# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
@@ -136,7 +143,9 @@
136 143
137/* Some libc's forget to declare these, do it ourself */ 144/* Some libc's forget to declare these, do it ourself */
138 145
146#if !ENABLE_PLATFORM_MINGW32
139extern char **environ; 147extern char **environ;
148#endif
140#if defined(__GLIBC__) && __GLIBC__ < 2 149#if defined(__GLIBC__) && __GLIBC__ < 2
141int vdprintf(int d, const char *format, va_list ap); 150int vdprintf(int d, const char *format, va_list ap);
142#endif 151#endif
@@ -149,6 +158,10 @@ int klogctl(int type, char *b, int len);
149# define BUFSIZ 4096 158# define BUFSIZ 4096
150#endif 159#endif
151 160
161/* Can't use ENABLE_PLATFORM_MINGW32 because it's also called by host compiler */
162#if ENABLE_PLATFORM_MINGW32
163# include "mingw.h"
164#endif
152 165
153/* Busybox does not use threads, we can speed up stdio. */ 166/* Busybox does not use threads, we can speed up stdio. */
154#ifdef HAVE_UNLOCKED_STDIO 167#ifdef HAVE_UNLOCKED_STDIO
@@ -830,6 +843,9 @@ char *safe_gethostname(void) FAST_FUNC;
830char* str_tolower(char *str) FAST_FUNC; 843char* str_tolower(char *str) FAST_FUNC;
831 844
832char *utoa(unsigned n) FAST_FUNC; 845char *utoa(unsigned n) FAST_FUNC;
846#if ENABLE_PLATFORM_MINGW32
847# define itoa bb_itoa
848#endif
833char *itoa(int n) FAST_FUNC; 849char *itoa(int n) FAST_FUNC;
834/* Returns a pointer past the formatted number, does NOT null-terminate */ 850/* Returns a pointer past the formatted number, does NOT null-terminate */
835char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; 851char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
@@ -1596,6 +1612,9 @@ typedef struct procps_status_t {
1596#if ENABLE_FEATURE_TOP_SMP_PROCESS 1612#if ENABLE_FEATURE_TOP_SMP_PROCESS
1597 int last_seen_on_cpu; 1613 int last_seen_on_cpu;
1598#endif 1614#endif
1615#if ENABLE_PLATFORM_MINGW32
1616 HANDLE snapshot;
1617#endif
1599} procps_status_t; 1618} procps_status_t;
1600/* flag bits for procps_scan(xx, flags) calls */ 1619/* flag bits for procps_scan(xx, flags) calls */
1601enum { 1620enum {
@@ -1634,7 +1653,11 @@ void free_procps_scan(procps_status_t* sp) FAST_FUNC;
1634procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC; 1653procps_status_t* procps_scan(procps_status_t* sp, int flags) FAST_FUNC;
1635/* Format cmdline (up to col chars) into char buf[size] */ 1654/* Format cmdline (up to col chars) into char buf[size] */
1636/* Puts [comm] if cmdline is empty (-> process is a kernel thread) */ 1655/* Puts [comm] if cmdline is empty (-> process is a kernel thread) */
1656#if !ENABLE_PLATFORM_MINGW32
1637void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC; 1657void read_cmdline(char *buf, int size, unsigned pid, const char *comm) FAST_FUNC;
1658#else
1659#define read_cmdline(buf, size, pid, comm) snprintf(buf, size, "[%s]", comm)
1660#endif
1638pid_t *find_pid_by_name(const char* procName) FAST_FUNC; 1661pid_t *find_pid_by_name(const char* procName) FAST_FUNC;
1639pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC; 1662pid_t *pidlist_reverse(pid_t *pidList) FAST_FUNC;
1640int starts_with_cpu(const char *str) FAST_FUNC; 1663int starts_with_cpu(const char *str) FAST_FUNC;
@@ -1770,7 +1793,11 @@ extern const char bb_path_wtmp_file[] ALIGN1;
1770#define bb_path_motd_file "/etc/motd" 1793#define bb_path_motd_file "/etc/motd"
1771 1794
1772#define bb_dev_null "/dev/null" 1795#define bb_dev_null "/dev/null"
1796#if ENABLE_PLATFORM_MINGW32
1797#define bb_busybox_exec_path get_busybox_exec_path()
1798#else
1773extern const char bb_busybox_exec_path[] ALIGN1; 1799extern const char bb_busybox_exec_path[] ALIGN1;
1800#endif
1774/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, 1801/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
1775 * but I want to save a few bytes here */ 1802 * but I want to save a few bytes here */
1776extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ 1803extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */