summaryrefslogtreecommitdiff
path: root/klibc/include
diff options
context:
space:
mode:
Diffstat (limited to 'klibc/include')
-rw-r--r--klibc/include/arch/m32r/klibc/archsetjmp.h21
-rw-r--r--klibc/include/arch/m32r/klibc/archsignal.h13
-rw-r--r--klibc/include/arch/m32r/klibc/archstat.h37
-rw-r--r--klibc/include/arch/m32r/klibc/archsys.h12
-rw-r--r--klibc/include/sched.h4
-rw-r--r--klibc/include/stdio.h4
-rw-r--r--klibc/include/stdlib.h1
-rw-r--r--klibc/include/sys/mount.h23
-rw-r--r--klibc/include/syslog.h9
9 files changed, 119 insertions, 5 deletions
diff --git a/klibc/include/arch/m32r/klibc/archsetjmp.h b/klibc/include/arch/m32r/klibc/archsetjmp.h
new file mode 100644
index 0000000000..e16a83517a
--- /dev/null
+++ b/klibc/include/arch/m32r/klibc/archsetjmp.h
@@ -0,0 +1,21 @@
+/*
+ * arch/m32r/include/klibc/archsetjmp.h
+ */
+
+#ifndef _KLIBC_ARCHSETJMP_H
+#define _KLIBC_ARCHSETJMP_H
+
+struct __jmp_buf {
+ unsigned long __r8;
+ unsigned long __r9;
+ unsigned long __r10;
+ unsigned long __r11;
+ unsigned long __r12;
+ unsigned long __r13;
+ unsigned long __r14;
+ unsigned long __r15;
+};
+
+typedef struct __jmp_buf jmp_buf[1];
+
+#endif /* _KLIBC_ARCHSETJMP_H */
diff --git a/klibc/include/arch/m32r/klibc/archsignal.h b/klibc/include/arch/m32r/klibc/archsignal.h
new file mode 100644
index 0000000000..02596e9a1c
--- /dev/null
+++ b/klibc/include/arch/m32r/klibc/archsignal.h
@@ -0,0 +1,13 @@
+/*
+ * arch/m32r/include/klibc/archsignal.h
+ *
+ * Architecture-specific signal definitions
+ *
+ */
+
+#ifndef _KLIBC_ARCHSIGNAL_H
+#define _KLIBC_ARCHSIGNAL_H
+
+/* No special stuff for this architecture */
+
+#endif
diff --git a/klibc/include/arch/m32r/klibc/archstat.h b/klibc/include/arch/m32r/klibc/archstat.h
new file mode 100644
index 0000000000..154820755f
--- /dev/null
+++ b/klibc/include/arch/m32r/klibc/archstat.h
@@ -0,0 +1,37 @@
+#ifndef _KLIBC_ARCHSTAT_H
+#define _KLIBC_ARCHSTAT_H
+
+#define _STATBUF_ST_NSEC
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct stat {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+ unsigned long __st_ino;
+
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+
+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long __pad4; /* future possible st_blocks high bits */
+
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+
+ unsigned long long st_ino;
+};
+
+#endif
diff --git a/klibc/include/arch/m32r/klibc/archsys.h b/klibc/include/arch/m32r/klibc/archsys.h
new file mode 100644
index 0000000000..386db8b505
--- /dev/null
+++ b/klibc/include/arch/m32r/klibc/archsys.h
@@ -0,0 +1,12 @@
+/*
+ * arch/m32r/include/klibc/archsys.h
+ *
+ * Architecture-specific syscall definitions
+ */
+
+#ifndef _KLIBC_ARCHSYS_H
+#define _KLIBC_ARCHSYS_H
+
+/* No special syscall definitions for this architecture */
+
+#endif /* _KLIBC_ARCHSYS_H */
diff --git a/klibc/include/sched.h b/klibc/include/sched.h
index fcf62a6e4f..3465b5705c 100644
--- a/klibc/include/sched.h
+++ b/klibc/include/sched.h
@@ -25,7 +25,9 @@ __extern int sched_yield(void);
__extern pid_t __clone2(int, void *, void *);
static __inline__ pid_t __clone(int _f, void *_sp)
{
- return __clone2(_f, _sp, 0);
+ /* If this is used with _sp != 0 it will have the effect of the sp
+ and rsp growing away from a single point in opposite directions. */
+ return __clone2(_f, _sp, _sp);
}
#else
__extern pid_t __clone(int, void *);
diff --git a/klibc/include/stdio.h b/klibc/include/stdio.h
index e00fac4d5e..d30622cfb2 100644
--- a/klibc/include/stdio.h
+++ b/klibc/include/stdio.h
@@ -90,7 +90,7 @@ fread(void *__p, size_t __s, size_t __n, FILE *__f)
}
extern __inline__ size_t
-fwrite(void *__p, size_t __s, size_t __n, FILE *__f)
+fwrite(const void *__p, size_t __s, size_t __n, FILE *__f)
{
return _fwrite(__p, __s*__n, __f)/__s;
}
@@ -104,6 +104,8 @@ __extern int sprintf(char *, const char *, ...);
__extern int vsprintf(char *, const char *, va_list);
__extern int snprintf(char *, size_t n, const char *, ...);
__extern int vsnprintf(char *, size_t n, const char *, va_list);
+__extern int asprintf(char **, const char *, ...);
+__extern int vasprintf(char **, const char *, va_list);
/* No buffering, so no flushing needed */
extern __inline__ int
diff --git a/klibc/include/stdlib.h b/klibc/include/stdlib.h
index be4e76ed9f..54d45043f7 100644
--- a/klibc/include/stdlib.h
+++ b/klibc/include/stdlib.h
@@ -21,6 +21,7 @@ __extern __noreturn abort(void);
static __inline__ int abs(int __n) {
return (__n < 0) ? -__n : __n;
}
+__extern int system(const char * string);
__extern int atexit(void (*)(void));
__extern int on_exit(void (*)(int, void *), void *);
__extern int atoi(const char *);
diff --git a/klibc/include/sys/mount.h b/klibc/include/sys/mount.h
index 313c90ec0e..0e1bce49bf 100644
--- a/klibc/include/sys/mount.h
+++ b/klibc/include/sys/mount.h
@@ -6,6 +6,7 @@
#define _SYS_MOUNT_H
#include <klibc/extern.h>
+#include <sys/ioctl.h>
/*
* These are the fs-independent mount-flags: up to 32 flags are supported
@@ -17,13 +18,16 @@
#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
-#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
+#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
#define MS_NOATIME 1024 /* Do not update access times. */
#define MS_NODIRATIME 2048 /* Do not update directory access times */
#define MS_BIND 4096
-#define MS_MOVE 8192
+#define MS_MOVE 8192
#define MS_REC 16384
#define MS_VERBOSE 32768
+#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
+#define MS_ONE_SECOND (1<<17) /* fs has 1 sec a/m/ctime resolution */
+#define MS_ACTIVE (1<<30)
#define MS_NOUSER (1<<31)
/*
@@ -40,7 +44,20 @@
/*
* umount2() flags
*/
-#define MNT_FORCE 1
+#define MNT_FORCE 1 /* Forcibly unmount */
+#define MNT_DETACH 2 /* Detach from tree only */
+#define MNT_EXPIRE 4 /* Mark for expiry */
+
+/*
+ * Block device ioctls
+ */
+#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
+#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
+#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
+#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
+#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
+#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
+#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
/*
* Prototypes
diff --git a/klibc/include/syslog.h b/klibc/include/syslog.h
index 551527a042..061dbcd5a7 100644
--- a/klibc/include/syslog.h
+++ b/klibc/include/syslog.h
@@ -47,6 +47,15 @@
#define LOG_FACMASK 01770
#define LOG_FAC(x) (((x) >> 3) & (LOG_FACMASK >> 3))
+/* openlog() flags; only LOG_PID and LOG_PERROR supported */
+#define LOG_PID 0x01 /* include pid with message */
+#define LOG_CONS 0x02 /* write to console on logger error */
+#define LOG_ODELAY 0x04 /* delay connection until syslog() */
+#define LOG_NDELAY 0x08 /* open connection immediately */
+#define LOG_NOWAIT 0x10 /* wait for child processes (unused on linux) */
+#define LOG_PERROR 0x20 /* additional logging to stderr */
+
+
__extern void openlog(const char *, int, int);
__extern void syslog(int, const char *, ...);
__extern void vsyslog(int, const char *, va_list);