summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-03-23 11:14:16 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-03-23 11:14:16 +0000
commitd5f635529a4dfe62b5ef565135b6f506040a66b0 (patch)
treeb66b2aa7422304b491d1f9c21986dd3f57cd017d /libc
parent9535cbf18c6b4415dc35c220ca4cca15eba5dc1b (diff)
select needs sys/select.h, str[n]casecmp/ffs needs strings.h, if BSD is not defined, gettimeofday has other prototype and tm_gmtoff/tm_zone do not exist
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/resolv.c1
-rw-r--r--libc/inet/rpc/ruserpass.c1
-rw-r--r--libc/misc/regex/regex.c1
-rw-r--r--libc/misc/time/time.c20
-rw-r--r--libc/misc/wchar/wchar.c1
-rw-r--r--libc/string/ffs.c1
-rw-r--r--libc/string/strcasecmp.c1
-rw-r--r--libc/string/strncasecmp.c1
-rw-r--r--libc/sysdeps/linux/common/gettimeofday.c5
-rw-r--r--libc/sysdeps/linux/common/select.c2
10 files changed, 30 insertions, 4 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 0221dbb59..560c56988 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -136,6 +136,7 @@
#define __FORCE_GLIBC
#include <features.h>
#include <string.h>
+#include <strings.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c
index 97f1284b3..0adcbf1d3 100644
--- a/libc/inet/rpc/ruserpass.c
+++ b/libc/inet/rpc/ruserpass.c
@@ -40,6 +40,7 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
libc_hidden_proto(strcat)
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index f39492bdf..192034b4e 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -36,6 +36,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
+#include <strings.h>
#include <stdlib.h>
#ifdef __UCLIBC_HAS_WCHAR__
#define RE_ENABLE_I18N
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 318069b33..93afa9b68 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -133,6 +133,7 @@
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
+#include <strings.h>
#include <time.h>
#include <sys/time.h>
#include <limits.h>
@@ -748,8 +749,13 @@ struct tm attribute_hidden *__time_localtime_tzi(register const time_t *__restri
_time_t2tm(x, days, result);
result->tm_isdst = dst;
#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
+# ifdef __USE_BSD
result->tm_gmtoff = - tzi[dst].gmt_offset;
result->tm_zone = lookup_tzname(tzi[dst].tzname);
+# else
+ result->__tm_gmtoff = - tzi[dst].gmt_offset;
+ result->__tm_zone = lookup_tzname(tzi[dst].tzname);
+# endif
#endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
} while ((++dst < 2)
&& ((result->tm_isdst = tm_isdst(result, tzi)) != 0));
@@ -1128,8 +1134,13 @@ size_t __XL_NPP(strftime)(char *__restrict s, size_t maxsize,
#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
#define RSP_TZUNLOCK ((void) 0)
-#define RSP_TZNAME timeptr->tm_zone
-#define RSP_GMT_OFFSET (-timeptr->tm_gmtoff)
+# ifdef __USE_BSD
+# define RSP_TZNAME timeptr->tm_zone
+# define RSP_GMT_OFFSET (-timeptr->tm_gmtoff)
+# else
+# define RSP_TZNAME timeptr->__tm_zone
+# define RSP_GMT_OFFSET (-timeptr->__tm_gmtoff)
+# endif
#else
@@ -2206,8 +2217,13 @@ struct tm attribute_hidden *_time_t2tm(const time_t *__restrict timer,
/* TODO -- should this be 0? */
p[4] = 0; /* result[8] .. tm_isdst */
#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
+# ifdef __USE_BSD
result->tm_gmtoff = 0;
result->tm_zone = utc_string;
+# else
+ result->__tm_gmtoff = 0;
+ result->__tm_zone = utc_string;
+# endif
#endif /* __UCLIBC_HAS_TM_EXTENSIONS__ */
return result;
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 64bab37e0..32ad41ee6 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -1191,6 +1191,7 @@ typedef struct {
#include <iconv.h>
#include <string.h>
+#include <strings.h>
#include <endian.h>
#include <byteswap.h>
diff --git a/libc/string/ffs.c b/libc/string/ffs.c
index d98383d4e..9a68dc302 100644
--- a/libc/string/ffs.c
+++ b/libc/string/ffs.c
@@ -8,6 +8,7 @@
/* ffsl,ffsll */
#include "_string.h"
+#include <strings.h>
libc_hidden_proto(ffs)
diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c
index ad4d1aab6..7fa521fb7 100644
--- a/libc/string/strcasecmp.c
+++ b/libc/string/strcasecmp.c
@@ -6,6 +6,7 @@
*/
#include "_string.h"
+#include <strings.h>
#include <ctype.h>
#include <locale.h>
diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c
index 0317bc124..9980dd704 100644
--- a/libc/string/strncasecmp.c
+++ b/libc/string/strncasecmp.c
@@ -6,6 +6,7 @@
*/
#include "_string.h"
+#include <strings.h>
#include <ctype.h>
#include <locale.h>
diff --git a/libc/sysdeps/linux/common/gettimeofday.c b/libc/sysdeps/linux/common/gettimeofday.c
index 2d8a6cb25..8e1cf57eb 100644
--- a/libc/sysdeps/linux/common/gettimeofday.c
+++ b/libc/sysdeps/linux/common/gettimeofday.c
@@ -11,6 +11,9 @@
#include <sys/time.h>
libc_hidden_proto(gettimeofday)
-
+#ifdef __USE_BSD
_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz);
+#else
+_syscall2(int, gettimeofday, struct timeval *, tv, void *, tz);
+#endif
libc_hidden_def(gettimeofday)
diff --git a/libc/sysdeps/linux/common/select.c b/libc/sysdeps/linux/common/select.c
index d5a0663fa..9a50d198a 100644
--- a/libc/sysdeps/linux/common/select.c
+++ b/libc/sysdeps/linux/common/select.c
@@ -8,7 +8,7 @@
*/
#include "syscalls.h"
-#include <unistd.h>
+#include <sys/select.h>
libc_hidden_proto(select)