summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/i386/openat.S
blob: 2dfdfe2a0aaa2a88aee69f08de5fd0a91ff60ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * arch/i386/openat.S
 *
 * Handle the openat() system call - oddball due to the varadic
 * prototype, which forces the use of the cdecl calling convention,
 * and the need for O_LARGEFILE.
 */

#include <asm/unistd.h>

/* <asm/fcntl.h>, despite the name, isn't assembly-safe */
#define O_LARGEFILE     0100000

#ifdef __NR_openat		/* Don't build if kernel headers too old */

	.globl	openat
	.type	openat,@function

openat:
	orl	$O_LARGEFILE,12(%esp)
	pushl	$__NR_openat
	jmp	__syscall_varadic

	.size	openat,.-openat

#endif