File:  [Early Linux] / linux / lib / open.c
Revision 1.1.1.5 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:12:04 2018 UTC (17 months, 3 weeks ago) by root
Branches: linus, MAIN
CVS tags: linux098, linux097, HEAD
linux 0.97

/*
 *  linux/lib/open.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 */

#define __LIBRARY__
#include <linux/unistd.h>
#include <stdarg.h>

int open(const char * filename, int flag, ...)
{
	register int res;
	va_list arg;

	va_start(arg,flag);
	__asm__("movl %2,%%ebx\n\t"
		"int $0x80"
		:"=a" (res)
		:"0" (__NR_open),"g" ((long)(filename)),"c" (flag),
		"d" (va_arg(arg,int)));
	if (res>=0)
		return res;
	errno = -res;
	return -1;
}

unix.superglobalmegacorp.com