From 02fec4701cee79f875c1d02b8b4aee09380dbcb8 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 4 Jan 2001 20:04:45 +0000 Subject: integrate dietlibc/stdio per default for cdrom and disk only installs --- mdk-stage1/dietlibc/include/sys/cdefs.h | 24 +++++++++ mdk-stage1/dietlibc/include/sys/ioctl.h | 10 ++++ mdk-stage1/dietlibc/include/sys/mman.h | 25 +++++++++ mdk-stage1/dietlibc/include/sys/mount.h | 81 ++++++++++++++++++++++++++++++ mdk-stage1/dietlibc/include/sys/resource.h | 7 +++ mdk-stage1/dietlibc/include/sys/select.h | 0 mdk-stage1/dietlibc/include/sys/socket.h | 20 ++++++++ mdk-stage1/dietlibc/include/sys/stat.h | 48 ++++++++++++++++++ mdk-stage1/dietlibc/include/sys/time.h | 24 +++++++++ mdk-stage1/dietlibc/include/sys/types.h | 33 ++++++++++++ mdk-stage1/dietlibc/include/sys/utsname.h | 35 +++++++++++++ mdk-stage1/dietlibc/include/sys/vfs.h | 11 ++++ mdk-stage1/dietlibc/include/sys/wait.h | 14 ++++++ 13 files changed, 332 insertions(+) create mode 100644 mdk-stage1/dietlibc/include/sys/cdefs.h create mode 100644 mdk-stage1/dietlibc/include/sys/ioctl.h create mode 100644 mdk-stage1/dietlibc/include/sys/mman.h create mode 100644 mdk-stage1/dietlibc/include/sys/mount.h create mode 100644 mdk-stage1/dietlibc/include/sys/resource.h create mode 100644 mdk-stage1/dietlibc/include/sys/select.h create mode 100644 mdk-stage1/dietlibc/include/sys/socket.h create mode 100644 mdk-stage1/dietlibc/include/sys/stat.h create mode 100644 mdk-stage1/dietlibc/include/sys/time.h create mode 100644 mdk-stage1/dietlibc/include/sys/types.h create mode 100644 mdk-stage1/dietlibc/include/sys/utsname.h create mode 100644 mdk-stage1/dietlibc/include/sys/vfs.h create mode 100644 mdk-stage1/dietlibc/include/sys/wait.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 new file mode 100644 index 000000000..9f256f59f --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/cdefs.h @@ -0,0 +1,24 @@ +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H + +#ifndef __cplusplus +#define throw () +#define __THROW +#else +#define __THROW throw () +#endif + +#ifndef __GNUC__ +#define __attribute__(xyz) +#endif + +#define __pure__ +#ifdef __GNUC__ +#if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96)) +#undef __pure__ +#define __pure__ __attribute__ ((__pure__)) +#endif + +#endif + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/ioctl.h b/mdk-stage1/dietlibc/include/sys/ioctl.h new file mode 100644 index 000000000..fca1aeeab --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/ioctl.h @@ -0,0 +1,10 @@ +#ifndef _IOCTL_H +#define _IOCTL_H + +#include +#include +#include + +int ioctl(int d, int request, ...) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/mman.h b/mdk-stage1/dietlibc/include/sys/mman.h new file mode 100644 index 000000000..03faa37ae --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/mman.h @@ -0,0 +1,25 @@ +#ifndef _SYS_MMAN_H +#define _SYS_MMAN_H + +#include +#include +#include + +#define MAP_FAILED ((void *) -1) + +extern void *mmap (void *__addr, size_t __len, int __prot, + int __flags, int __fd, off_t __offset); + +extern int munmap (void *__addr, size_t __len) __THROW; +extern int mprotect (void *__addr, size_t __len, int __prot) __THROW; +extern int msync (void *__addr, size_t __len, int __flags) __THROW; +extern void *mremap (void *__addr, size_t __old_len, size_t __new_len, + int __may_move) __THROW; +extern int mincore (void *__start, size_t __len, unsigned char *__vec); + +#ifdef __quad_t +extern void *mmap64 (void *__addr, size_t __len, int __prot, + int __flags, int __fd, off64_t __offset) __THROW; +#endif + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/mount.h b/mdk-stage1/dietlibc/include/sys/mount.h new file mode 100644 index 000000000..1c4368a2f --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/mount.h @@ -0,0 +1,81 @@ +#ifndef _SYS_MOUNT_H +#define _SYS_MOUNT_H 1 + +#include + +#define BLOCK_SIZE 1024 +#define BLOCK_SIZE_BITS 10 + +/* 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 +}; + +/* Flags that can be altered by MS_REMOUNT */ +#define MS_RMT_MASK (MS_RDONLY | MS_MANDLOCK) + + +/* Magic mount flag number. Has to be or-ed to the flag values. */ + +#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 */ diff --git a/mdk-stage1/dietlibc/include/sys/resource.h b/mdk-stage1/dietlibc/include/sys/resource.h new file mode 100644 index 000000000..953fc0eb2 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/resource.h @@ -0,0 +1,7 @@ +#ifndef _SYS_RESOURCE_H +#define _SYS_RESOURCE_H + +#include +#include + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/select.h b/mdk-stage1/dietlibc/include/sys/select.h new file mode 100644 index 000000000..e69de29bb diff --git a/mdk-stage1/dietlibc/include/sys/socket.h b/mdk-stage1/dietlibc/include/sys/socket.h new file mode 100644 index 000000000..659c88e99 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/socket.h @@ -0,0 +1,20 @@ +#ifndef _SYS_SOCKET_H +#define _SYS_SOCKET_H + +#include +#include + +int socket(int domain, int type, int protocol); +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 ); + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/stat.h b/mdk-stage1/dietlibc/include/sys/stat.h new file mode 100644 index 000000000..7c3504218 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/stat.h @@ -0,0 +1,48 @@ +#ifndef _SYS_STAT_H +#define _SYS_STAT_H + +#include +#include + +#include +#include + +#ifdef __alpha__ +#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) + +#define stat64(file,buf) __dietstat64(file,buf) +#define fstat64(file,buf) __dietfstat64(file,buf) +#define lstat64(file,buf) __dietlstat64(file,buf) + +#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; + +extern mode_t umask (mode_t __mask) __THROW; + +extern int mkdir (const char *__path, mode_t __mode) __THROW; + +extern int mknod (const char *__path, mode_t __mode, dev_t __dev) __THROW; + +extern int mkfifo (const char *__path, mode_t __mode) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/time.h b/mdk-stage1/dietlibc/include/sys/time.h new file mode 100644 index 000000000..069d50a83 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/time.h @@ -0,0 +1,24 @@ +#ifndef _SYS_TIME_H +#define _SYS_TIME_H 1 + +#include + +#include +#include + +#if defined __USE_GNU || defined __USE_BSD +typedef struct timezone *__timezone_ptr_t; +#else +typedef void *__timezone_ptr_t; +#endif + +int getitimer(int which, struct itimerval *value) __THROW; +int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) __THROW; + +int gettimeofday(struct timeval *tv, struct timezone *tz) __THROW; +int settimeofday(const struct timeval *tv , const struct timezone *tz) __THROW; + +extern int adjtime (const struct timeval *__delta, + struct timeval *__olddelta) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/types.h b/mdk-stage1/dietlibc/include/sys/types.h new file mode 100644 index 000000000..34dbaa9f1 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/types.h @@ -0,0 +1,33 @@ +#ifndef _SYS_TYPES_H +#define _SYS_TYPES_H + +#include +#include +#include + +#ifdef __GNUC__ +#define __quad_t __quad_t +typedef long long int __quad_t; +typedef unsigned long long int __u_quad_t; +#else +#warning no long long support - no 64 bit file I/O support +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; +#endif + + +#ifdef __quad_t +typedef __quad_t off64_t; +typedef __u_quad_t ino64_t; +typedef __quad_t blkcnt64_t; +#endif + +typedef long int fpos_t; + +#define socklen_t socklen_t +typedef unsigned int socklen_t; + +typedef long int blksize_t; +typedef long int blkcnt_t; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/utsname.h b/mdk-stage1/dietlibc/include/sys/utsname.h new file mode 100644 index 000000000..37bf6c811 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/utsname.h @@ -0,0 +1,35 @@ +#ifndef _SYS_UTSNAME_H +#define _SYS_UTSNAME_H 1 + +#include + +/* Length of the entries in `struct utsname' is 65. */ +#define _UTSNAME_LENGTH 65 +#define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH + +/* Linux provides as additional information in the `struct utsname' + the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH + to a value != 0 to activate this entry. */ +#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH + +struct utsname { + /* Name of the implementation of the operating system. */ + char sysname[_UTSNAME_LENGTH]; + + /* Name of this node on the network. */ + char nodename[_UTSNAME_NODENAME_LENGTH]; + + /* Current release level of this implementation. */ + char release[_UTSNAME_LENGTH]; + /* Current version level of this release. */ + char version[_UTSNAME_LENGTH]; + + /* Name of the hardware type the system is running on. */ + char machine[_UTSNAME_LENGTH]; + + /* Name of the domain of this node on the network. */ + char domainname[_UTSNAME_DOMAIN_LENGTH]; +}; + +extern int uname (struct utsname *__name) __THROW; +#endif diff --git a/mdk-stage1/dietlibc/include/sys/vfs.h b/mdk-stage1/dietlibc/include/sys/vfs.h new file mode 100644 index 000000000..e4740a225 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/vfs.h @@ -0,0 +1,11 @@ +#ifndef _SYS_VFS_H +#define _SYS_VFS_H + +#include +#include +#include + +int statfs(const char *path, struct statfs *buf) __THROW; +int fstatfs(int fd, struct statfs *buf) __THROW; + +#endif diff --git a/mdk-stage1/dietlibc/include/sys/wait.h b/mdk-stage1/dietlibc/include/sys/wait.h new file mode 100644 index 000000000..91b5da348 --- /dev/null +++ b/mdk-stage1/dietlibc/include/sys/wait.h @@ -0,0 +1,14 @@ +#ifndef _SYS_WAIT_H +#define _SYS_WAIT_H + +#include +#include + +pid_t wait(int *status) __THROW; +pid_t waitpid(pid_t pid, int *status, int options) __THROW; + +pid_t wait3(int *status, int options, struct rusage *rusage) __THROW; + +pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage) __THROW; + +#endif -- cgit v1.2.1