summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/include
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/dietlibc/include')
-rw-r--r--mdk-stage1/dietlibc/include/assert.h7
-rw-r--r--mdk-stage1/dietlibc/include/dirent.h6
-rw-r--r--mdk-stage1/dietlibc/include/dlfcn.h1
-rw-r--r--mdk-stage1/dietlibc/include/linux/eventpoll.h17
-rw-r--r--mdk-stage1/dietlibc/include/signal.h2
-rw-r--r--mdk-stage1/dietlibc/include/stdarg-cruft.h2
-rw-r--r--mdk-stage1/dietlibc/include/string.h2
-rw-r--r--mdk-stage1/dietlibc/include/sys/ioctl.h6
-rw-r--r--mdk-stage1/dietlibc/include/sys/poll.h36
-rw-r--r--mdk-stage1/dietlibc/include/sys/time.h2
-rw-r--r--mdk-stage1/dietlibc/include/sys/types.h4
-rw-r--r--mdk-stage1/dietlibc/include/sys/vfs.h3
-rw-r--r--mdk-stage1/dietlibc/include/termios.h2
-rw-r--r--mdk-stage1/dietlibc/include/unistd.h3
14 files changed, 76 insertions, 17 deletions
diff --git a/mdk-stage1/dietlibc/include/assert.h b/mdk-stage1/dietlibc/include/assert.h
index b135369b8..a8ce3ce87 100644
--- a/mdk-stage1/dietlibc/include/assert.h
+++ b/mdk-stage1/dietlibc/include/assert.h
@@ -22,10 +22,17 @@ extern void __assert_fail (const char *__assertion, const char *__file,
#ifdef NDEBUG
#define assert(expr)
#else
+#ifdef expect
+# define assert(expr) \
+ ((void) (expect((long)(expr),0) ? 0 : \
+ (__assert_fail (#expr, \
+ __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
+#else
# define assert(expr) \
((void) ((expr) ? 0 : \
(__assert_fail (#expr, \
__FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
#endif
+#endif
#endif
diff --git a/mdk-stage1/dietlibc/include/dirent.h b/mdk-stage1/dietlibc/include/dirent.h
index 636ebc2b0..ad8b3a41a 100644
--- a/mdk-stage1/dietlibc/include/dirent.h
+++ b/mdk-stage1/dietlibc/include/dirent.h
@@ -41,8 +41,12 @@ long int telldir (DIR *__dirp) __THROW;
int scandir(const char *dir, struct dirent ***namelist,
int (*selection)(const struct dirent *),
int (*compar)(const struct dirent **, const struct dirent **)) __THROW;
+int scandir64(const char *dir, struct dirent64 ***namelist,
+ int (*selection)(const struct dirent64 *),
+ int (*compar)(const struct dirent64 **, const struct dirent64 **)) __THROW;
int alphasort(const struct dirent **a, const struct dirent **b) __THROW __attribute__((const));
+int alphasort64(const struct dirent64 **a, const struct dirent64 **b) __THROW __attribute__((const));
#define MAXNAMLEN NAME_MAX
@@ -53,6 +57,8 @@ extern int dirfd(DIR *dirp) __THROW;
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
#define dirent dirent64
#define readdir readdir64
+#define scandir scandir64
+#define alphasort alphasort64
#endif
#endif
diff --git a/mdk-stage1/dietlibc/include/dlfcn.h b/mdk-stage1/dietlibc/include/dlfcn.h
index 5195cc41f..0ddcafdba 100644
--- a/mdk-stage1/dietlibc/include/dlfcn.h
+++ b/mdk-stage1/dietlibc/include/dlfcn.h
@@ -8,6 +8,7 @@
#define RTLD_GLOBAL 0x10000
#define RTLD_DEFAULT ((void*)1)
+#define RTLD_NEXT ((void*)2)
void *dlopen (const char *filename, int flag);
const char *dlerror(void);
diff --git a/mdk-stage1/dietlibc/include/linux/eventpoll.h b/mdk-stage1/dietlibc/include/linux/eventpoll.h
new file mode 100644
index 000000000..19990ac2a
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/linux/eventpoll.h
@@ -0,0 +1,17 @@
+#ifndef _LINUX_EVENTPOLL_H
+#define _LINUX_EVENTPOLL_H
+
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <sys/shm.h>
+
+#define POLLFD_X_PAGE (PAGE_SIZE / sizeof(struct pollfd))
+#define EP_FDS_PAGES(n) (((n) + POLLFD_X_PAGE - 1) / POLLFD_X_PAGE)
+#define EP_MAP_SIZE(n) (EP_FDS_PAGES(n) * PAGE_SIZE * 2)
+
+struct evpoll {
+ int ep_timeout;
+ unsigned long ep_resoff;
+};
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/signal.h b/mdk-stage1/dietlibc/include/signal.h
index 65f968755..fdc0518cf 100644
--- a/mdk-stage1/dietlibc/include/signal.h
+++ b/mdk-stage1/dietlibc/include/signal.h
@@ -168,7 +168,7 @@
#define SA_RESTART SV_INTR
#define SA_RESETHAND SV_RESET
#define SA_INTERRUPT 0x10
-#define SA_DEFER 0x20
+#define SA_NODEFER 0x20
#define SA_SHIRQ 0x40
#define SA_NOCLDWAIT 0x100 /* not supported yet */
#define SA_SIGINFO 0x200
diff --git a/mdk-stage1/dietlibc/include/stdarg-cruft.h b/mdk-stage1/dietlibc/include/stdarg-cruft.h
index c25973fe8..fbd9e0ca4 100644
--- a/mdk-stage1/dietlibc/include/stdarg-cruft.h
+++ b/mdk-stage1/dietlibc/include/stdarg-cruft.h
@@ -1,4 +1,4 @@
-#if defined(__sparc__) || defined(__alpha__)
+#if defined(__sparc__) || defined(__alpha__) || defined(__mips__)
enum {
__no_type_class = -1,
__void_type_class,
diff --git a/mdk-stage1/dietlibc/include/string.h b/mdk-stage1/dietlibc/include/string.h
index bc81f2ac3..4c56bf8bb 100644
--- a/mdk-stage1/dietlibc/include/string.h
+++ b/mdk-stage1/dietlibc/include/string.h
@@ -62,6 +62,8 @@ char *strerror(int errnum) __THROW;
#ifdef _GNU_SOURCE
const char *strsignal(int signum) __THROW;
void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) __THROW;
+
+char *strndup(const char *s,size_t n) __attribute_malloc__ __THROW;
#endif
char *strtok(char *s, const char *delim) __THROW;
diff --git a/mdk-stage1/dietlibc/include/sys/ioctl.h b/mdk-stage1/dietlibc/include/sys/ioctl.h
index 630abc515..a7890f038 100644
--- a/mdk-stage1/dietlibc/include/sys/ioctl.h
+++ b/mdk-stage1/dietlibc/include/sys/ioctl.h
@@ -21,6 +21,12 @@
#include <sys/hppa-ioctl.h>
#endif
+/* used for /dev/epoll */
+#define EP_ALLOC _IOR('P', 1, int)
+#define EP_POLL _IOWR('P', 2, struct evpoll)
+#define EP_FREE _IO('P', 3)
+#define EP_ISPOLLED _IOWR('P', 4, struct pollfd)
+
int ioctl(int d, int request, ...) __THROW;
#endif
diff --git a/mdk-stage1/dietlibc/include/sys/poll.h b/mdk-stage1/dietlibc/include/sys/poll.h
index d17f6422c..fe36df79d 100644
--- a/mdk-stage1/dietlibc/include/sys/poll.h
+++ b/mdk-stage1/dietlibc/include/sys/poll.h
@@ -3,19 +3,32 @@
#include <sys/cdefs.h>
-#define POLLIN 0x0001
-#define POLLPRI 0x0002
-#define POLLOUT 0x0004
-#define POLLERR 0x0008
-#define POLLHUP 0x0010
-#define POLLNVAL 0x0020
-#define POLLRDNORM 0x0040
-#define POLLRDBAND 0x0080
-#define POLLWRBAND 0x0200
-#define POLLMSG 0x0400
+enum {
+ POLLIN = 0x0001,
+#define POLLIN POLLIN
+ POLLPRI = 0x0002,
+#define POLLPRI POLLPRI
+ POLLOUT = 0x0004,
+#define POLLOUT POLLOUT
+ POLLERR = 0x0008,
+#define POLLERR POLLERR
+ POLLHUP = 0x0010,
+#define POLLHUP POLLHUP
+ POLLNVAL = 0x0020,
+#define POLLNVAL POLLNVAL
+ POLLRDNORM = 0x0040,
+#define POLLRDNORM POLLRDNORM
+ POLLRDBAND = 0x0080,
+#define POLLRDBAND POLLRDBAND
+ POLLWRBAND = 0x0200,
+#define POLLWRBAND POLLWRBAND
+ POLLMSG = 0x0400,
+#define POLLMSG POLLMSG
/* POLLREMOVE is for /dev/epoll (/dev/misc/eventpoll),
* a new event notification mechanism for 2.6 */
-#define POLLREMOVE 0x1000
+ POLLREMOVE = 0x1000,
+#define POLLREMOVE POLLREMOVE
+};
#if defined(__sparc__) || defined (__mips__)
#define POLLWRNORM POLLOUT
@@ -31,5 +44,4 @@ struct pollfd {
extern int poll(struct pollfd *ufds, unsigned int nfds, int timeout) __THROW;
-
#endif /* _SYS_POLL_H */
diff --git a/mdk-stage1/dietlibc/include/sys/time.h b/mdk-stage1/dietlibc/include/sys/time.h
index 8d345a77d..9fc40089f 100644
--- a/mdk-stage1/dietlibc/include/sys/time.h
+++ b/mdk-stage1/dietlibc/include/sys/time.h
@@ -46,6 +46,8 @@ int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue
int gettimeofday(struct timeval *tv, struct timezone *tz) __THROW;
int settimeofday(const struct timeval *tv , const struct timezone *tz) __THROW;
+extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW;
+
extern int adjtime (const struct timeval *delta, struct timeval *olddelta) __THROW;
struct tm {
diff --git a/mdk-stage1/dietlibc/include/sys/types.h b/mdk-stage1/dietlibc/include/sys/types.h
index eadc1bb65..a3d2bf4be 100644
--- a/mdk-stage1/dietlibc/include/sys/types.h
+++ b/mdk-stage1/dietlibc/include/sys/types.h
@@ -41,7 +41,7 @@ typedef unsigned long int clock_t; /* Used for system times in
Used for timer ID returned by timer_create().
*/
-#if defined(__alpha__) || defined(__mips__) || defined(__ppc__) || defined(__hppa__) || defined(__sparc64__) \
+#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__hppa__) || defined(__sparc64__) \
|| defined(__x86_64__) || defined(__ia64__)
typedef unsigned int uid_t; /* Used for user IDs. */
typedef unsigned int gid_t; /* Used for group IDs. */
@@ -52,7 +52,7 @@ typedef unsigned short gid_t; /* Used for group IDs. */
typedef unsigned short dev_t; /* Used for device IDs. */
#endif
-#if defined(__alpha__) || defined(__mips__) || defined(__ppc__) || defined(__sparc64__) \
+#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__sparc64__) \
|| defined(__x86_64__) || defined(__ia64__)
typedef unsigned int mode_t; /* Used for some file attributes. */
#else
diff --git a/mdk-stage1/dietlibc/include/sys/vfs.h b/mdk-stage1/dietlibc/include/sys/vfs.h
index cf7e7f946..19b3242bb 100644
--- a/mdk-stage1/dietlibc/include/sys/vfs.h
+++ b/mdk-stage1/dietlibc/include/sys/vfs.h
@@ -11,6 +11,9 @@ typedef struct {
struct statfs {
long f_type;
long f_bsize;
+#ifdef __mips__
+ long f_frsize;
+#endif
long f_blocks;
long f_bfree;
#ifndef __mips__
diff --git a/mdk-stage1/dietlibc/include/termios.h b/mdk-stage1/dietlibc/include/termios.h
index c9998595c..12e02c5d7 100644
--- a/mdk-stage1/dietlibc/include/termios.h
+++ b/mdk-stage1/dietlibc/include/termios.h
@@ -76,6 +76,8 @@ typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
+#define _POSIX_VDISABLE '\0'
+
#if defined(__i386__) || defined(__arm__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__) || defined(__s390x__) || defined(__x86_64__)
#define NCCS 19
struct termios {
diff --git a/mdk-stage1/dietlibc/include/unistd.h b/mdk-stage1/dietlibc/include/unistd.h
index 0f49b2b9b..2fba5d584 100644
--- a/mdk-stage1/dietlibc/include/unistd.h
+++ b/mdk-stage1/dietlibc/include/unistd.h
@@ -34,10 +34,10 @@ extern int access (const char *__name, int __type) __THROW;
off_t lseek(int fildes, off_t offset, int whence) __THROW;
#ifndef __NO_STAT64
loff_t lseek64(int fildes, loff_t offset, int whence) __THROW;
-#endif
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
#define lseek(fildes,offset,whence) lseek64(fildes,offset,whence)
#endif
+#endif
int chdir(const char *path) __THROW;
int fchdir(int fd) __THROW;
@@ -182,6 +182,7 @@ int _sysctl(struct __sysctl_args *args) __THROW;
#define _SC_CLK_TCK 1
#define _SC_ARG_MAX 2
+#define _SC_NGROUPS_MAX 3
#define _SC_OPEN_MAX 4
#define _SC_PAGESIZE 5
#define _SC_NPROCESSORS_ONLN 6