OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / i386 / posix_fadvise64.S
1 /* Copyright (C) 1995-2000,2002,2003,2004,2005,2006
2       Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #include <_lfs_64.h>
20 #include <sys/syscall.h>
21
22 #ifdef __NR_fadvise64_64
23
24 .text
25 .global posix_fadvise64
26 .type   posix_fadvise64,%function
27 posix_fadvise64:
28         /* Save regs  */
29         pushl   %ebp
30         pushl   %ebx
31         pushl   %esi
32         pushl   %edi
33
34         movl $__NR_fadvise64_64, %eax   /* Syscall number in %eax.  */
35
36         movl    20(%esp), %ebx
37         movl    24(%esp), %ecx
38         movl    28(%esp), %edx
39         movl    32(%esp), %esi
40         movl    36(%esp), %edi
41         movl    40(%esp), %ebp
42
43         /* Do the system call trap.  */
44         int $0x80
45
46         /* Restore regs  */
47         popl    %edi
48         popl    %esi
49         popl    %ebx
50         popl    %ebp
51
52         /* Returns 0 on success, else an error code.  */
53         negl    %eax
54
55         /* Successful; return the syscall's value.  */
56         ret
57 .size posix_fadvise64,.-posix_fadvise64
58 #endif