aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.src.h1
-rw-r--r--include/libbb.h25
-rw-r--r--include/platform.h19
3 files changed, 23 insertions, 22 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index 2d55ffec7..87d9cbb7b 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -409,7 +409,6 @@ IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP))
409IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) 409IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP))
410IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) 410IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP))
411IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) 411IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP))
412IF_WHO(APPLET(who, BB_DIR_USR_BIN, BB_SUID_DROP))
413IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) 412IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
414IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat)) 413IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat))
415IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz)) 414IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz))
diff --git a/include/libbb.h b/include/libbb.h
index 363fe53df..6e63e65f5 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -52,6 +52,12 @@
52#ifdef HAVE_SYS_STATFS_H 52#ifdef HAVE_SYS_STATFS_H
53# include <sys/statfs.h> 53# include <sys/statfs.h>
54#endif 54#endif
55/* Don't do this here:
56 * #include <sys/sysinfo.h>
57 * Some linux/ includes pull in conflicting definition
58 * of struct sysinfo (only in some toolchanins), which breaks build.
59 * Include sys/sysinfo.h only in those files which need it.
60 */
55#if ENABLE_SELINUX 61#if ENABLE_SELINUX
56# include <selinux/selinux.h> 62# include <selinux/selinux.h>
57# include <selinux/context.h> 63# include <selinux/context.h>
@@ -142,25 +148,6 @@ int klogctl(int type, char *b, int len);
142#if !defined __FreeBSD__ 148#if !defined __FreeBSD__
143char *dirname(char *path); 149char *dirname(char *path);
144#endif 150#endif
145/* Include our own copy of struct sysinfo to avoid binary compatibility
146 * problems with Linux 2.4, which changed things. Grumble, grumble. */
147struct sysinfo {
148 long uptime; /* Seconds since boot */
149 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
150 unsigned long totalram; /* Total usable main memory size */
151 unsigned long freeram; /* Available memory size */
152 unsigned long sharedram; /* Amount of shared memory */
153 unsigned long bufferram; /* Memory used by buffers */
154 unsigned long totalswap; /* Total swap space size */
155 unsigned long freeswap; /* swap space still available */
156 unsigned short procs; /* Number of current processes */
157 unsigned short pad; /* Padding needed for m68k */
158 unsigned long totalhigh; /* Total high memory size */
159 unsigned long freehigh; /* Available high memory size */
160 unsigned int mem_unit; /* Memory unit size in bytes */
161 char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
162};
163int sysinfo(struct sysinfo* info);
164#ifndef PATH_MAX 151#ifndef PATH_MAX
165# define PATH_MAX 256 152# define PATH_MAX 256
166#endif 153#endif
diff --git a/include/platform.h b/include/platform.h
index 319ef4a9e..e22c42007 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -125,7 +125,7 @@
125 125
126/* Make all declarations hidden (-fvisibility flag only affects definitions) */ 126/* Make all declarations hidden (-fvisibility flag only affects definitions) */
127/* (don't include system headers after this until corresponding pop!) */ 127/* (don't include system headers after this until corresponding pop!) */
128#if __GNUC_PREREQ(4,1) && !ENABLE_PLATFORM_MINGW32 128#if __GNUC_PREREQ(4,1) && !defined(__CYGWIN__) && !ENABLE_PLATFORM_MINGW32
129# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)") 129# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
130# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop") 130# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop")
131#else 131#else
@@ -283,6 +283,7 @@ typedef unsigned smalluint;
283#if defined __GLIBC__ \ 283#if defined __GLIBC__ \
284 || defined __UCLIBC__ \ 284 || defined __UCLIBC__ \
285 || defined __dietlibc__ \ 285 || defined __dietlibc__ \
286 || defined __BIONIC__ \
286 || defined _NEWLIB_VERSION 287 || defined _NEWLIB_VERSION
287# include <features.h> 288# include <features.h>
288#endif 289#endif
@@ -346,6 +347,10 @@ typedef unsigned smalluint;
346# endif 347# endif
347#endif 348#endif
348 349
350#if defined(__CYGWIN__)
351# define MAXSYMLINKS SYMLOOP_MAX
352#endif
353
349 354
350/* ---- Who misses what? ------------------------------------ */ 355/* ---- Who misses what? ------------------------------------ */
351 356
@@ -423,6 +428,15 @@ typedef unsigned smalluint;
423# undef HAVE_NET_ETHERNET_H 428# undef HAVE_NET_ETHERNET_H
424#endif 429#endif
425 430
431#if defined(__CYGWIN__)
432# undef HAVE_CLEARENV
433# undef HAVE_FDPRINTF
434# undef HAVE_MEMRCHR
435# undef HAVE_PTSNAME_R
436# undef HAVE_STRVERSCMP
437# undef HAVE_UNLOCKED_LINE_OPS
438#endif
439
426/* These BSD-derived OSes share many similarities */ 440/* These BSD-derived OSes share many similarities */
427#if (defined __digital__ && defined __unix__) \ 441#if (defined __digital__ && defined __unix__) \
428 || defined __APPLE__ \ 442 || defined __APPLE__ \
@@ -515,7 +529,8 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC
515#endif 529#endif
516 530
517#ifndef HAVE_GETLINE 531#ifndef HAVE_GETLINE
518#include <stdio.h> /* for FILE */ 532# include <stdio.h> /* for FILE */
533# include <sys/types.h> /* size_t */
519extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC; 534extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
520#endif 535#endif
521 536