Annotation of linux/lib/open.c, revision 1.1.1.5

1.1.1.2   root        1: /*
                      2:  *  linux/lib/open.c
                      3:  *
1.1.1.5 ! root        4:  *  Copyright (C) 1991, 1992  Linus Torvalds
1.1.1.2   root        5:  */
                      6: 
1.1       root        7: #define __LIBRARY__
1.1.1.4   root        8: #include <linux/unistd.h>
1.1       root        9: #include <stdarg.h>
                     10: 
                     11: int open(const char * filename, int flag, ...)
                     12: {
                     13:        register int res;
                     14:        va_list arg;
                     15: 
                     16:        va_start(arg,flag);
1.1.1.3   root       17:        __asm__("movl %2,%%ebx\n\t"
                     18:                "int $0x80"
1.1       root       19:                :"=a" (res)
1.1.1.3   root       20:                :"0" (__NR_open),"g" ((long)(filename)),"c" (flag),
1.1       root       21:                "d" (va_arg(arg,int)));
                     22:        if (res>=0)
                     23:                return res;
                     24:        errno = -res;
                     25:        return -1;
                     26: }

unix.superglobalmegacorp.com