diff options
Diffstat (limited to 'libc/kinclude')
-rw-r--r-- | libc/kinclude/Config | 2 | ||||
-rw-r--r-- | libc/kinclude/Makefile | 11 | ||||
-rw-r--r-- | libc/kinclude/arch/errno.h | 4 | ||||
-rw-r--r-- | libc/kinclude/arch/stat.h | 19 | ||||
-rw-r--r-- | libc/kinclude/arch/types.h | 28 | ||||
-rw-r--r-- | libc/kinclude/linuxmt/resource.h | 73 | ||||
-rw-r--r-- | libc/kinclude/linuxmt/stat.h | 6 | ||||
-rw-r--r-- | libc/kinclude/linuxmt/types.h | 12 |
8 files changed, 103 insertions, 52 deletions
diff --git a/libc/kinclude/Config b/libc/kinclude/Config index f3d064f..6c9970d 100644 --- a/libc/kinclude/Config +++ b/libc/kinclude/Config @@ -1 +1 @@ -kinc: The kernel include files +kinc: Example kernel include files diff --git a/libc/kinclude/Makefile b/libc/kinclude/Makefile index aa4ef72..7722d68 100644 --- a/libc/kinclude/Makefile +++ b/libc/kinclude/Makefile @@ -6,16 +6,11 @@ all: @: transfer: - -@rm -f ../include/linuxmt + -@rm -f ../include/linuxmt ../include/arch ln -s ../kinclude/linuxmt ../include + ln -s ../kinclude/arch ../include @touch Used -# This is for use once linuxmt's syscall interface really gets working. -# beware the arch directory must be removed when you do this. -real_transfer: - -@rm -f ../include/linuxmt - cd ../include ; ln -s ../../linuxmt/include/linuxmt . - clean: - -@rm -f ../include/linuxmt + -@rm -f ../include/linuxmt ../include/arch -@rm -f Used diff --git a/libc/kinclude/arch/errno.h b/libc/kinclude/arch/errno.h index ee3fcab..8cee74b 100644 --- a/libc/kinclude/arch/errno.h +++ b/libc/kinclude/arch/errno.h @@ -1,5 +1,5 @@ -#ifndef _I86_ERRNO_H -#define _I86_ERRNO_H +#ifndef __ARCH_ERRNO_H +#define __ARCH_ERRNO_H #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ diff --git a/libc/kinclude/arch/stat.h b/libc/kinclude/arch/stat.h new file mode 100644 index 0000000..fd77f62 --- /dev/null +++ b/libc/kinclude/arch/stat.h @@ -0,0 +1,19 @@ + +#ifndef _ARCH_STAT_H +#define _ARCH_STAT_H + +struct stat +{ + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; +}; +#endif diff --git a/libc/kinclude/arch/types.h b/libc/kinclude/arch/types.h index 00afeed..f59faf6 100644 --- a/libc/kinclude/arch/types.h +++ b/libc/kinclude/arch/types.h @@ -2,33 +2,9 @@ #ifndef __LINUXMT_8086_TYPES #define __LINUXMT_8086_TYPES - -/* First we define all of the __u and __s types...*/ - -typedef unsigned char __u8; -typedef unsigned char * __pu8; -typedef char __s8; -typedef char * __ps8; - -typedef unsigned short __u16; -typedef unsigned short * __pu16; -typedef short __s16; -typedef short * __ps16; - -typedef unsigned long __u32; -typedef unsigned long * __pu32; -typedef long __s32; -typedef long * __ps32; - -/* __uint == 16bit here */ - -typedef unsigned int __uint; -typedef int __sint; -typedef unsigned int * __puint; -typedef int * __psint; - -/* Then we define registers, etc... */ +#include <asm/types.h> + struct _registers { __u16 ksp, sp, ss, ax, bx, cx, dx, di, si, ds, es, bp, ip, cs, flags; }; diff --git a/libc/kinclude/linuxmt/resource.h b/libc/kinclude/linuxmt/resource.h new file mode 100644 index 0000000..061570a --- /dev/null +++ b/libc/kinclude/linuxmt/resource.h @@ -0,0 +1,73 @@ +/* + * Resource control/accounting header file for linux-86 + */ + +#ifndef __LINUXMT_RESOURCE_H +#define __LINUXMT_RESOURCE_H + +#include <features.h> +#include <sys/time.h> +#include <limits.h> + +#define RUSAGE_SELF 0 +#define RUSAGE_CHILDREN (-1) +#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* maximum resident set size */ + long ru_ixrss; /* integral shared memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary " */ +}; + +#define RLIM_INFINITY ((long)(~0UL>>1)) + +struct rlimit { + long rlim_cur; + long rlim_max; +}; + +#define PRIO_MIN (-20) +#define PRIO_MAX 20 + +#define PRIO_PROCESS 0 +#define PRIO_PGRP 1 +#define PRIO_USER 2 + +#define RLIMIT_CPU 0 /* CPU time in ms */ +#define RLIMIT_FSIZE 1 /* Maximum filesize */ +#define RLIMIT_DATA 2 /* max data size */ +#define RLIMIT_STACK 3 /* max stack size */ +#define RLIMIT_CORE 4 /* max core file size */ +#define RLIMIT_RSS 5 /* max resident set size */ +#define RLIMIT_NPROC 6 /* max number of processes */ +#define RLIMIT_NOFILE 7 /* max number of open files */ +#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ + +#define RLIM_NLIMITS 9 + +extern int getrlimit __P ((int __resource, + struct rlimit *__rlp)); +extern int setrlimit __P ((int __resource, + __const struct rlimit *__rlp)); + +extern int getpriority __P((int __which, int __who)); +extern int setpriority __P((int __which, int __who, + int __prio)); + +extern int __getrusage __P ((int __who, struct rusage *__rusage)); +extern int getrusage __P ((int __who, struct rusage *__rusage)); + +#endif /* __LINUXMT_RESOURCE_H */ diff --git a/libc/kinclude/linuxmt/stat.h b/libc/kinclude/linuxmt/stat.h index 9fbd191..a600583 100644 --- a/libc/kinclude/linuxmt/stat.h +++ b/libc/kinclude/linuxmt/stat.h @@ -1,11 +1,7 @@ #ifndef __LINUXMT_STAT_H #define __LINUXMT_STAT_H -#ifdef __KERNEL__ - -#include "../arch/stat.h" - -#endif +#include <arch/stat.h> #define S_IFMT 00170000 #ifdef __LINUXMT_NETWORK__ diff --git a/libc/kinclude/linuxmt/types.h b/libc/kinclude/linuxmt/types.h index 8e5236a..3d32320 100644 --- a/libc/kinclude/linuxmt/types.h +++ b/libc/kinclude/linuxmt/types.h @@ -1,16 +1,7 @@ #ifndef __LINUXMT_TYPES_H #define __LINUXMT_TYPES_H -#include "../arch/types.h" - -/* Throw away _FUNCTION parameters - the syntax is ripped off of Minix's - _PROTOTYPE. Considering Borland did the same thing to MFC on a bigger - scale, I don't think PH will mind :) */ - -/* Yes, this should be in arch/types.h too */ - -#define _FUNCTION(function, params) function() -#define _VFUNCTION(functiom, params) (*function) () +#include <asm/types.h> typedef __u32 off_t; typedef __u16 pid_t; @@ -22,6 +13,7 @@ typedef __u16 nlink_t; typedef __u16 mode_t; typedef __u32 loff_t; typedef __u32 speed_t; +typedef __u16 size_t; typedef __u16 dev_t; typedef __uint ino_t; |