summaryrefslogtreecommitdiffstats
path: root/loader/minilibc.h
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-05-06 18:50:50 +0000
committerMatt Wilson <msw@redhat.com>1999-05-06 18:50:50 +0000
commit3a8069a96bd89cf4fdedf03eccc7781d17fec6a7 (patch)
treebc8a9fd486a54535a719c838663728d32b5b0448 /loader/minilibc.h
parenta47ebb82d8e73b4a940baeec26584b53908865b1 (diff)
downloadanaconda-3a8069a96bd89cf4fdedf03eccc7781d17fec6a7.tar.gz
anaconda-3a8069a96bd89cf4fdedf03eccc7781d17fec6a7.tar.xz
anaconda-3a8069a96bd89cf4fdedf03eccc7781d17fec6a7.zip
beginnings of new stage1
Diffstat (limited to 'loader/minilibc.h')
-rw-r--r--loader/minilibc.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/loader/minilibc.h b/loader/minilibc.h
new file mode 100644
index 000000000..fac68f2a4
--- /dev/null
+++ b/loader/minilibc.h
@@ -0,0 +1,82 @@
+#include <stdarg.h>
+
+#define NULL ((void *) 0)
+
+#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status))
+#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+#define WTERMSIG(status) ((status) & 0x7f)
+#define WSTOPSIG(status) WEXITSTATUS(status)
+#define WIFEXITED(status) (WTERMSIG(status) == 0)
+
+#define MS_MGC_VAL 0xc0ed0000
+
+#define isspace(a) (a == ' ' || a == '\t')
+
+extern char ** _environ;
+
+extern int errno;
+
+#include <linux/if.h>
+#include <linux/un.h>
+#include <linux/socket.h>
+#include <linux/types.h>
+#include <linux/net.h>
+#include <linux/time.h>
+#include <asm/posix_types.h>
+#include <asm/termios.h>
+#include <asm/ioctls.h>
+#include <asm/unistd.h>
+#include <asm/fcntl.h>
+
+#ifndef MINILIBC_INTERNAL
+static inline _syscall5(int,mount,const char *,spec,const char *,dir,const char *,type,unsigned long,rwflag,const void *,data);
+static inline _syscall5(int,_newselect,int,n,fd_set *,rd,fd_set *,wr,fd_set *,ex,struct timeval *,timeval);
+static inline _syscall4(int,wait4,pid_t,pid,int *,status,int,opts,void *,rusage)
+static inline _syscall3(int,write,int,fd,const char *,buf,unsigned long,count)
+static inline _syscall3(int,reboot,int,magic,int,magic_too,int,flag)
+static inline _syscall3(int,execve,const char *,fn,void *,argv,void *,envp)
+static inline _syscall3(int,read,int,fd,const char *,buf,unsigned long,count)
+static inline _syscall3(int,open,const char *,fn,int,flags,mode_t,mode)
+static inline _syscall3(int,ioctl,int,fd,int,request,void *,argp)
+static inline _syscall2(int,dup2,int,one,int,two)
+static inline _syscall2(int,kill,pid_t,pid,int,sig)
+static inline _syscall2(int,symlink,const char *,a,const char *,b)
+static inline _syscall2(int,chmod,const char * ,path,mode_t,mode)
+static inline _syscall2(int,sethostname,const char *,name,int,len)
+static inline _syscall2(int,setdomainname,const char *,name,int,len)
+static inline _syscall1(int,umount,const char *,dir)
+static inline _syscall1(int,unlink,const char *,fn)
+static inline _syscall1(int,close,int,fd)
+static inline _syscall0(int,getpid)
+static inline _syscall0(int,sync)
+static inline _syscall0(int,fork)
+static inline _syscall0(pid_t,setsid)
+static inline _syscall1(int,exit,int,exitcode)
+static inline _syscall3(int,syslog,int, type, char *, buf, int, len);
+#else
+static inline _syscall5(int,_newselect,int,n,fd_set *,rd,fd_set *,wr,fd_set *,ex,struct timeval *,timeval);
+static inline _syscall3(int,write,int,fd,const char *,buf,unsigned long,count)
+static inline _syscall2(int,socketcall,int,code,unsigned long *, args)
+#endif
+
+#define select _newselect
+
+extern int errno;
+
+inline int socket(int a, int b, int c);
+inline int bind(int a, void * b, int c);
+inline int listen(int a, int b);
+inline int accept(int a, void * addr, void * addr2);
+int strlen(const char * string);
+char * strcpy(char * dst, const char * src);
+void * memcpy(void * dst, const void * src, int count);
+void sleep(int secs);
+int strcmp(const char * a, const char * b);
+int strncmp(const char * a, const char * b, int len);
+void printint(int i);
+void printf(char * fmt, ...);
+char * strchr(char * str, int ch);
+char * strncpy(char * dst, const char * src, int len);
+
+void printstr(char * string);