From 167217bec15c9c7aa70ba2a3dc9c689b3cd91872 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 14 May 2001 14:19:32 +0000 Subject: import new version of dietlibc --- mdk-stage1/dietlibc/include/sys/cdefs.h | 12 ++++ mdk-stage1/dietlibc/include/sys/file.h | 8 +++ mdk-stage1/dietlibc/include/sys/ipc.h | 8 +++ mdk-stage1/dietlibc/include/sys/kd.h | 6 ++ mdk-stage1/dietlibc/include/sys/mman.h | 8 +++ mdk-stage1/dietlibc/include/sys/mount.h | 84 ++++-------------------- mdk-stage1/dietlibc/include/sys/msg.h | 13 ++++ mdk-stage1/dietlibc/include/sys/mtio.h | 6 ++ mdk-stage1/dietlibc/include/sys/param.h | 8 +++ mdk-stage1/dietlibc/include/sys/poll.h | 11 ++++ mdk-stage1/dietlibc/include/sys/ptrace.h | 10 +++ mdk-stage1/dietlibc/include/sys/reboot.h | 9 +++ mdk-stage1/dietlibc/include/sys/resource.h | 9 +++ mdk-stage1/dietlibc/include/sys/select.h | 6 -- mdk-stage1/dietlibc/include/sys/sem.h | 11 ++++ mdk-stage1/dietlibc/include/sys/sendfile.h | 9 +++ mdk-stage1/dietlibc/include/sys/shm.h | 17 +++++ mdk-stage1/dietlibc/include/sys/signal.h | 1 + mdk-stage1/dietlibc/include/sys/socket.h | 51 +++++++++++---- mdk-stage1/dietlibc/include/sys/stat.h | 38 ++++++----- mdk-stage1/dietlibc/include/sys/syscall.h | 6 ++ mdk-stage1/dietlibc/include/sys/sysinfo.h | 9 +++ mdk-stage1/dietlibc/include/sys/syslog.h | 102 +++++++++++++++++++++++++++++ mdk-stage1/dietlibc/include/sys/time.h | 22 +++++++ mdk-stage1/dietlibc/include/sys/times.h | 6 ++ mdk-stage1/dietlibc/include/sys/uio.h | 9 +++ mdk-stage1/dietlibc/include/sys/un.h | 8 +++ mdk-stage1/dietlibc/include/sys/wait.h | 23 +++++++ 28 files changed, 401 insertions(+), 109 deletions(-) create mode 100644 mdk-stage1/dietlibc/include/sys/file.h create mode 100644 mdk-stage1/dietlibc/include/sys/ipc.h create mode 100644 mdk-stage1/dietlibc/include/sys/kd.h create mode 100644 mdk-stage1/dietlibc/include/sys/msg.h create mode 100644 mdk-stage1/dietlibc/include/sys/mtio.h create mode 100644 mdk-stage1/dietlibc/include/sys/param.h create mode 100644 mdk-stage1/dietlibc/include/sys/poll.h create mode 100644 mdk-stage1/dietlibc/include/sys/ptrace.h create mode 100644 mdk-stage1/dietlibc/include/sys/reboot.h create mode 100644 mdk-stage1/dietlibc/include/sys/sem.h create mode 100644 mdk-stage1/dietlibc/include/sys/sendfile.h create mode 100644 mdk-stage1/dietlibc/include/sys/shm.h create mode 100644 mdk-stage1/dietlibc/include/sys/signal.h create mode 100644 mdk-stage1/dietlibc/include/sys/syscall.h create mode 100644 mdk-stage1/dietlibc/include/sys/sysinfo.h create mode 100644 mdk-stage1/dietlibc/include/sys/syslog.h create mode 100644 mdk-stage1/dietlibc/include/sys/times.h create mode 100644 mdk-stage1/dietlibc/include/sys/uio.h create mode 100644 mdk-stage1/dietlibc/include/sys/un.h (limited to 'mdk-stage1/dietlibc/include/sys') diff --git a/mdk-stage1/dietlibc/include/sys/cdefs.h b/mdk-stage1/dietlibc/include/sys/cdefs.h index 9f256f59f..895bb74b8 100644 --- a/mdk-stage1/dietlibc/include/sys/cdefs.h +++ b/mdk-stage1/dietlibc/include/sys/cdefs.h @@ -1,11 +1,17 @@ #ifndef _SYS_CDEFS_H #define _SYS_CDEFS_H +#define __dietlibc__ + #ifndef __cplusplus #define throw () #define __THROW +#define __BEGIN_DECLS +#define __END_DECLS #else #define __THROW throw () +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } #endif #ifndef __GNUC__ @@ -19,6 +25,12 @@ #define __pure__ __attribute__ ((__pure__)) #endif +#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95) +#define __restrict__ +#endif + #endif +#define __P(x) x + #endif diff --git a/mdk-stage1/dietlibc/include/sys/file.h b/mdk-stage1/dietlibc/include/sys/file.h new file mode 100644 index 000000000..91b6b547e --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/file.h @@ -0,0 +1,8 @@ +#ifndef _SYS_FILE_H +#define _SYS_FILE_H + +#include + +extern int fcntl(int fd, int cmd, ...) __THROW; + +#endif /* _SYS_FILE_H */ diff --git a/mdk-stage1/dietlibc/include/sys/ipc.h b/mdk-stage1/dietlibc/include/sys/ipc.h new file mode 100644 index 000000000..9184a2a82 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/ipc.h @@ -0,0 +1,8 @@ +#ifndef _SYS_IPC_H +#define _SYS_IPC_H + +#include +#include +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/kd.h b/mdk-stage1/dietlibc/include/sys/kd.h new file mode 100644 index 000000000..9e9a5152b --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/kd.h @@ -0,0 +1,6 @@ +#ifndef _SYS_KD_H +#define _SYS_KD_H + +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/mman.h b/mdk-stage1/dietlibc/include/sys/mman.h index 03faa37ae..dc398ba90 100644 --- a/mdk-stage1/dietlibc/include/sys/mman.h +++ b/mdk-stage1/dietlibc/include/sys/mman.h @@ -4,6 +4,11 @@ #include #include #include +#include + +#ifndef PAGE_SIZE +#warning PAGE_SIZE undefined +#endif #define MAP_FAILED ((void *) -1) @@ -22,4 +27,7 @@ extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, off64_t __offset) __THROW; #endif +int mlockall(int flags) __THROW; +int munlockall(void) __THROW; + #endif diff --git a/mdk-stage1/dietlibc/include/sys/mount.h b/mdk-stage1/dietlibc/include/sys/mount.h index 1c4368a2f..2e9e86774 100644 --- a/mdk-stage1/dietlibc/include/sys/mount.h +++ b/mdk-stage1/dietlibc/include/sys/mount.h @@ -1,81 +1,19 @@ #ifndef _SYS_MOUNT_H -#define _SYS_MOUNT_H 1 +#define _SYS_MOUNT_H -#include +#include +#include +#include -#define BLOCK_SIZE 1024 -#define BLOCK_SIZE_BITS 10 +int mount(const char* specialfile, const char* dir, const char* filesystemtype, + unsigned long rwflag, const void * data) __THROW; -/* These are the fs-independent mount-flags: up to 16 flags are - supported */ -enum -{ - MS_RDONLY = 1, /* Mount read-only. */ -#define MS_RDONLY MS_RDONLY - MS_NOSUID = 2, /* Ignore suid and sgid bits. */ -#define MS_NOSUID MS_NOSUID - MS_NODEV = 4, /* Disallow access to device special files. */ -#define MS_NODEV MS_NODEV - MS_NOEXEC = 8, /* Disallow program execution. */ -#define MS_NOEXEC MS_NOEXEC - MS_SYNCHRONOUS = 16, /* Writes are synced at once. */ -#define MS_SYNCHRONOUS MS_SYNCHRONOUS - MS_REMOUNT = 32, /* Alter flags of a mounted FS. */ -#define MS_REMOUNT MS_REMOUNT - MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ -#define MS_MANDLOCK MS_MANDLOCK - S_WRITE = 128, /* Write on file/directory/symlink. */ -#define S_WRITE S_WRITE - S_APPEND = 256, /* Append-only file. */ -#define S_APPEND S_APPEND - S_IMMUTABLE = 512, /* Immutable file. */ -#define S_IMMUTABLE S_IMMUTABLE - MS_NOATIME = 1024, /* Do not update access times. */ -#define MS_NOATIME MS_NOATIME - MS_NODIRATIME = 2048, /* Do not update directory access times. */ -#define MS_NODIRATIME MS_NODIRATIME - MS_BIND = 4096, /* Bind directory at different place. */ -#define MS_BIND MS_BIND -}; +int umount(const char *specialfile) __THROW; -/* Flags that can be altered by MS_REMOUNT */ -#define MS_RMT_MASK (MS_RDONLY | MS_MANDLOCK) +int umount(const char *dir) __THROW; +int umount2(const char *specialfile, int mflag) __THROW; -/* Magic mount flag number. Has to be or-ed to the flag values. */ +int umount2(const char *dir, int mflag) __THROW; -#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */ -#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */ - - -/* The read-only stuff doesn't really belong here, but any other place - is probably as bad and I don't want to create yet another include - file. */ - -#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. */ - - -/* Possible value for FLAGS parameter of `umount2'. */ -enum -{ - MNT_FORCE = 1 /* Force unmounting. */ -#define MNT_FORCE MNT_FORCE -}; - - -/* Mount a filesystem. */ -int mount(const char *specialfile, const char *dir, const char *filesystemtype, unsigned long rwflag, const void *data) __THROW; - -/* Unmount a filesystem. */ -extern int umount (const char *__special_file) __THROW; - -/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */ -extern int umount2 (const char *__special_file, int __flags) __THROW; - -#endif /* _SYS_MOUNT_H */ +#endif diff --git a/mdk-stage1/dietlibc/include/sys/msg.h b/mdk-stage1/dietlibc/include/sys/msg.h new file mode 100644 index 000000000..ea1e470b6 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/msg.h @@ -0,0 +1,13 @@ +#ifndef _SYS_MSG_H +#define _SYS_MSG_H + +#include +#include +#include + +extern int msgctl (int msqid, int cmd, struct msqid_ds *buf) __THROW; +extern int msgget (key_t key, int msgflg) __THROW; +extern int msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg) __THROW; +extern int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/mtio.h b/mdk-stage1/dietlibc/include/sys/mtio.h new file mode 100644 index 000000000..e70663407 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/mtio.h @@ -0,0 +1,6 @@ +#ifndef _SYS_MTIO_H +#define _SYS_MTIO_H + +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/param.h b/mdk-stage1/dietlibc/include/sys/param.h new file mode 100644 index 000000000..05f4d40e2 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/param.h @@ -0,0 +1,8 @@ +#ifndef _SYS_PARAM_H +#define _SYS_PARAM_H + +#include + +#define MAXPATHLEN PATH_MAX + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/poll.h b/mdk-stage1/dietlibc/include/sys/poll.h new file mode 100644 index 000000000..adce26687 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/poll.h @@ -0,0 +1,11 @@ +#ifndef _SYS_POLL_H +#define _SYS_POLL_H + +#include + +#include + +extern int poll(struct pollfd *ufds, unsigned int nfds, int timeout) __THROW; + + +#endif /* _SYS_POLL_H */ diff --git a/mdk-stage1/dietlibc/include/sys/ptrace.h b/mdk-stage1/dietlibc/include/sys/ptrace.h new file mode 100644 index 000000000..9dd730bc6 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/ptrace.h @@ -0,0 +1,10 @@ +#ifndef _SYS_PTRACE_H +#define _SYS_PTRACE_H + +#include + +#include + +extern long int ptrace (int request, ...) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/reboot.h b/mdk-stage1/dietlibc/include/sys/reboot.h new file mode 100644 index 000000000..ba58d296a --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/reboot.h @@ -0,0 +1,9 @@ +#ifndef _SYS_REBOOT_H +#define _SYS_REBOOT_H + +#include + +/* Reboot or halt the system. */ +int reboot (int flag, void *arg); + +#endif /* _SYS_REBOOT_H */ diff --git a/mdk-stage1/dietlibc/include/sys/resource.h b/mdk-stage1/dietlibc/include/sys/resource.h index 953fc0eb2..442434cd1 100644 --- a/mdk-stage1/dietlibc/include/sys/resource.h +++ b/mdk-stage1/dietlibc/include/sys/resource.h @@ -4,4 +4,13 @@ #include #include +int getpriority(int which, int who) __THROW; +int setpriority(int which, int who, int prio) __THROW; + +int getrlimit (int resource, struct rlimit *rlim); +int getrusage (int who, struct rusage *usage); +int setrlimit (int resource, const struct rlimit *rlim); + +typedef unsigned long rlim_t; + #endif diff --git a/mdk-stage1/dietlibc/include/sys/select.h b/mdk-stage1/dietlibc/include/sys/select.h index fa166a530..e69de29bb 100644 --- a/mdk-stage1/dietlibc/include/sys/select.h +++ b/mdk-stage1/dietlibc/include/sys/select.h @@ -1,6 +0,0 @@ -#ifndef _SYS_SELECT_H -#define _SYS_SELECT_H 1 - -int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); - -#endif diff --git a/mdk-stage1/dietlibc/include/sys/sem.h b/mdk-stage1/dietlibc/include/sys/sem.h new file mode 100644 index 000000000..cc182649c --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/sem.h @@ -0,0 +1,11 @@ +#ifndef _SYS_SEM_H +#define _SYS_SEM_H + +#include +#include + +extern int semget( key_t key, int nsems, int semflg) __THROW; +extern int semctl(int semid, int semnum, int cmd, union semun arg) __THROW; +extern int semop(int semid, struct sembuf *sops, unsigned nsops) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/sendfile.h b/mdk-stage1/dietlibc/include/sys/sendfile.h new file mode 100644 index 000000000..2e0c04add --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/sendfile.h @@ -0,0 +1,9 @@ +#ifndef _SYS_SENDFILE_H +#define _SYS_SENDFILE_H + +#include + +extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *offset, + size_t __count) __THROW; + +#endif /* sys/sendfile.h */ diff --git a/mdk-stage1/dietlibc/include/sys/shm.h b/mdk-stage1/dietlibc/include/sys/shm.h new file mode 100644 index 000000000..c27f5ddcf --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/shm.h @@ -0,0 +1,17 @@ +#ifndef _SYS_SHM_H +#define _SYS_SHM_H + +#include +#include +#include + +#ifndef PAGE_SIZE +#define PAGE_SIZE getpagesize() +#endif + +extern int shmget(key_t key, int size, int shmflg) __THROW; +extern void *shmat(int shmid, const void *shmaddr, int shmflg) __THROW; +extern int shmdt (const void *shmaddr) __THROW; +extern int shmctl(int shmid, int cmd, struct shmid_ds *buf) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/signal.h b/mdk-stage1/dietlibc/include/sys/signal.h new file mode 100644 index 000000000..2e602dad8 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/signal.h @@ -0,0 +1 @@ +#include diff --git a/mdk-stage1/dietlibc/include/sys/socket.h b/mdk-stage1/dietlibc/include/sys/socket.h index f590c35c4..a1435501c 100644 --- a/mdk-stage1/dietlibc/include/sys/socket.h +++ b/mdk-stage1/dietlibc/include/sys/socket.h @@ -1,21 +1,46 @@ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H +#include #include #include -int socket(int domain, int type, int protocol); -int listen (int fd, int n); -int accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen); -int bind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); -int recv(int s, void *buf, size_t len, int flags); -int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -int recvmsg(int s, struct msghdr *msg, int flags); -int send(int s, const void *msg, size_t len, int flags); -int sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); -int sendmsg(int s, const struct msghdr *msg, int flags); -int getpeername(int s, struct sockaddr *name, socklen_t *namelen); -int getsockname(int s , struct sockaddr * name , socklen_t * namelen ); +#ifndef SOCK_DGRAM +/* the Linux kernel headers suck really badly on non-x86 */ +#define SOCK_STREAM 1 /* stream (connection) socket */ +#define SOCK_DGRAM 2 /* datagram (conn.less) socket */ +#define SOCK_RAW 3 /* raw socket */ +#define SOCK_RDM 4 /* reliably-delivered message */ +#define SOCK_SEQPACKET 5 /* sequential packet socket */ +#define SOCK_PACKET 10 /* linux specific way of */ +#endif + +struct sockaddr_storage { + char __tmp[sizeof(struct sockaddr)]; +}; + +int socket(int domain, int type, int protocol) __THROW; +int accept(int s, struct sockaddr *addr, socklen_t *addrlen) __THROW; +int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) __THROW; +int bind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen) __THROW; +int recv(int s, void *buf, size_t len, int flags) __THROW; +int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) __THROW; +int recvmsg(int s, struct msghdr *msg, int flags) __THROW; +int send(int s, const void *msg, size_t len, int flags) __THROW; +int sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) __THROW; +int sendmsg(int s, const struct msghdr *msg, int flags) __THROW; + +int getpeername(int s, struct sockaddr *name, socklen_t *namelen) __THROW; +int getsockname(int s , struct sockaddr * name , socklen_t * namelen) __THROW; + +int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) __THROW; +int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) __THROW; + +int listen(int s, int backlog) __THROW; + +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 +int shutdown(int s, int how) __THROW; #endif diff --git a/mdk-stage1/dietlibc/include/sys/stat.h b/mdk-stage1/dietlibc/include/sys/stat.h index 7c3504218..10fddfa42 100644 --- a/mdk-stage1/dietlibc/include/sys/stat.h +++ b/mdk-stage1/dietlibc/include/sys/stat.h @@ -7,32 +7,32 @@ #include #include -#ifdef __alpha__ +#ifndef STAT64_HAS_BROKEN_ST_INO #define __NO_STAT64 #endif -#define stat(file,buf) __dietstat(file,buf) -#define fstat(file,buf) __dietfstat(file,buf) -#define lstat(file,buf) __dietlstat(file,buf) +extern int stat(const char *__file, struct stat *__buf) __THROW; +extern int fstat(int __fd, struct stat *__buf) __THROW; +extern int lstat(const char *__file, struct stat *__buf) __THROW; -#define stat64(file,buf) __dietstat64(file,buf) -#define fstat64(file,buf) __dietfstat64(file,buf) -#define lstat64(file,buf) __dietlstat64(file,buf) +#ifdef __NO_STAT64 +#undef _FILE_OFFSET_BITS +#else +extern int stat64(const char *__file, struct stat64 *__buf) __THROW; +extern int fstat64(int __fd, struct stat64 *__buf) __THROW; +extern int lstat64(const char *__file, struct stat64 *__buf) __THROW; +#endif + +#if _FILE_OFFSET_BITS == 64 +#define lstat(file,buf) lstat64(file,buf) +#define fstat(file,buf) fstat64(file,buf) +#define stat stat64 +#endif #define major(dev) (((dev)>>8) & 0xff) #define minor(dev) ((dev) & 0xff) #define makedev(major, minor) ((((unsigned int) (major)) << 8) | ((unsigned int) (minor))) -extern int __dietstat (const char *__file, struct stat *__buf) __THROW; -extern int __dietfstat (int __fd, struct stat *__buf) __THROW; -extern int __dietlstat (const char *__file, struct stat *__buf) __THROW; - -#ifndef __NO_STAT64 -extern int __dietstat64 (const char *__file, struct stat64 *__buf) __THROW; -extern int __dietfstat64 (int __fd, struct stat64 *__buf) __THROW; -extern int __dietlstat64 (const char *__file, struct stat64 *__buf) __THROW; -#endif - extern int chmod (const char *__file, mode_t __mode) __THROW; extern int fchmod (int __fd, mode_t __mode) __THROW; @@ -45,4 +45,8 @@ extern int mknod (const char *__path, mode_t __mode, dev_t __dev) __THROW; extern int mkfifo (const char *__path, mode_t __mode) __THROW; +#define S_IREAD S_IRUSR +#define S_IWRITE S_IWUSR +#define S_IEXEC S_IXUSR + #endif diff --git a/mdk-stage1/dietlibc/include/sys/syscall.h b/mdk-stage1/dietlibc/include/sys/syscall.h new file mode 100644 index 000000000..5d6b5a4ad --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/syscall.h @@ -0,0 +1,6 @@ +#ifndef _SYSCALL_H +#define _SYSCALL_H + +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/sysinfo.h b/mdk-stage1/dietlibc/include/sys/sysinfo.h new file mode 100644 index 000000000..5f059d469 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/sysinfo.h @@ -0,0 +1,9 @@ +#ifndef _SYS_SYSINFO_H +#define _SYS_SYSINFO_H + +#include +#include + +int sysinfo(struct sysinfo *info) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/syslog.h b/mdk-stage1/dietlibc/include/sys/syslog.h new file mode 100644 index 000000000..91bf0d1fa --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/syslog.h @@ -0,0 +1,102 @@ +#ifndef _SYS_SYSLOG_H +#define _SYS_SYSLOG_H 1 + +#include +#include + +#define _PATH_LOG "/dev/log" + +/* + * priorities/facilities are encoded into a single 32-bit quantity, where the + * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility + * (0-big number). Both the priorities and the facilities map roughly + * one-to-one to strings in the syslogd(8) source code. This mapping is + * included in this file. + * + * priorities (these are ordered) + */ +#define LOG_EMERG 0 /* system is unusable */ +#define LOG_ALERT 1 /* action must be taken immediately */ +#define LOG_CRIT 2 /* critical conditions */ +#define LOG_ERR 3 /* error conditions */ +#define LOG_WARNING 4 /* warning conditions */ +#define LOG_NOTICE 5 /* normal but significant condition */ +#define LOG_INFO 6 /* informational */ +#define LOG_DEBUG 7 /* debug-level messages */ + +#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ + /* extract priority */ +#define LOG_PRI(p) ((p) & LOG_PRIMASK) +#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) + +/* facility codes */ +#define LOG_KERN (0<<3) /* kernel messages */ +#define LOG_USER (1<<3) /* random user-level messages */ +#define LOG_MAIL (2<<3) /* mail system */ +#define LOG_DAEMON (3<<3) /* system daemons */ +#define LOG_AUTH (4<<3) /* security/authorization messages */ +#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ +#define LOG_LPR (6<<3) /* line printer subsystem */ +#define LOG_NEWS (7<<3) /* network news subsystem */ +#define LOG_UUCP (8<<3) /* UUCP subsystem */ +#define LOG_CRON (9<<3) /* clock daemon */ +#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ +#define LOG_FTP (11<<3) /* ftp daemon */ + + /* other codes through 15 reserved for system use */ +#define LOG_LOCAL0 (16<<3) /* reserved for local use */ +#define LOG_LOCAL1 (17<<3) /* reserved for local use */ +#define LOG_LOCAL2 (18<<3) /* reserved for local use */ +#define LOG_LOCAL3 (19<<3) /* reserved for local use */ +#define LOG_LOCAL4 (20<<3) /* reserved for local use */ +#define LOG_LOCAL5 (21<<3) /* reserved for local use */ +#define LOG_LOCAL6 (22<<3) /* reserved for local use */ +#define LOG_LOCAL7 (23<<3) /* reserved for local use */ + +#define LOG_NFACILITIES 24 /* current number of facilities */ +#define LOG_FACMASK 0x03f8 /* mask to extract facility part */ + /* facility of pri */ +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) + +/* + * arguments to setlogmask. + */ +#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ +#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ + +/* + * Option flags for openlog. + * + * LOG_ODELAY no longer does anything. + * LOG_NDELAY is the inverse of what it used to be. + */ +#define LOG_PID 0x01 /* log the pid with each message */ +#define LOG_CONS 0x02 /* log on the console if errors in sending */ +#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ +#define LOG_NDELAY 0x08 /* don't delay open */ +#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ +#define LOG_PERROR 0x20 /* log to stderr as well */ + +/* Open connection to system logger. */ +/* against the glibc-routine ident has not to be const ! */ +/* instead ident is limited to 80 characters ! */ +void openlog (const char *ident, int option, int facility); + +void closelog (void) __THROW; + +int setlogmask (int mask) __THROW; + +void syslog (int priority, const char *format, ...) __THROW; + +void vsyslog (int priority, const char *format, va_list arg_ptr) __THROW; + +/* yuck yuck yuck, only needed for syslogd. */ +typedef struct _code { + char *c_name; + int c_val; +} CODE; + +extern CODE prioritynames[]; +extern CODE facilitynames[]; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/time.h b/mdk-stage1/dietlibc/include/sys/time.h index 069d50a83..11144f57b 100644 --- a/mdk-stage1/dietlibc/include/sys/time.h +++ b/mdk-stage1/dietlibc/include/sys/time.h @@ -21,4 +21,26 @@ int settimeofday(const struct timeval *tv , const struct timezone *tz) __THROW; extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __THROW; +struct tm +{ + int tm_sec; /* Seconds. [0-60] (1 leap second) */ + int tm_min; /* Minutes. [0-59] */ + int tm_hour; /* Hours. [0-23] */ + int tm_mday; /* Day. [1-31] */ + int tm_mon; /* Month. [0-11] */ + int tm_year; /* Year - 1900. */ + int tm_wday; /* Day of week. [0-6] */ + int tm_yday; /* Days in year.[0-365] */ + int tm_isdst; /* DST. [-1/0/1]*/ + + long int tm_gmtoff; /* Seconds east of UTC. */ + const char *tm_zone; /* Timezone abbreviation. */ +}; + +struct tm* gmtime(const time_t *t) __THROW; +struct tm* gmtime_r(const time_t *t, struct tm *r) __THROW; + +struct tm* localtime(const time_t *t) __THROW; +struct tm* localtime_r(const time_t *t, struct tm *r) __THROW; + #endif diff --git a/mdk-stage1/dietlibc/include/sys/times.h b/mdk-stage1/dietlibc/include/sys/times.h new file mode 100644 index 000000000..7a1db07fa --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/times.h @@ -0,0 +1,6 @@ +#ifndef _SYS_TIMES_H +#define _SYS_TIMES_H + +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/uio.h b/mdk-stage1/dietlibc/include/sys/uio.h new file mode 100644 index 000000000..d64fd33c9 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/uio.h @@ -0,0 +1,9 @@ +#ifndef _SYS_UIO +#define _SYS_UIO 1 + +#include + +int readv(int filedes, const struct iovec *vector, size_t count); +int writev(int filedes, const struct iovec *vector, size_t count); + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/un.h b/mdk-stage1/dietlibc/include/sys/un.h new file mode 100644 index 000000000..213d9290e --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/un.h @@ -0,0 +1,8 @@ +#ifndef _SYS_UN_H +#define _SYS_UN_H + +#include + +#include + +#endif /* sys/un.h */ diff --git a/mdk-stage1/dietlibc/include/sys/wait.h b/mdk-stage1/dietlibc/include/sys/wait.h index 91b5da348..eb70112e2 100644 --- a/mdk-stage1/dietlibc/include/sys/wait.h +++ b/mdk-stage1/dietlibc/include/sys/wait.h @@ -3,6 +3,29 @@ #include #include +#include + +/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ +#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) +#define WEXITSTATUS __WEXITSTATUS + +/* If WIFSIGNALED(STATUS), the terminating signal. */ +#define __WTERMSIG(status) ((status) & 0x7f) +#define WTERMSIG __WTERMSIG + +/* If WIFSTOPPED(STATUS), the signal that stopped the child. */ +#define __WSTOPSIG(status) __WEXITSTATUS(status) +#define WSTOPSIG __WSTOPSIG + +/* Nonzero if STATUS indicates normal termination. */ +#define WIFEXITED(status) (__WTERMSIG(status) == 0) + +/* Nonzero if STATUS indicates termination by a signal. */ +#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) + +/* Nonzero if STATUS indicates the child is stopped. */ +#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) + pid_t wait(int *status) __THROW; pid_t waitpid(pid_t pid, int *status, int options) __THROW; -- cgit v1.2.1