riscv64: fix linking with binutils 2.40
[uclibc-ng.git] / libc / sysdeps / linux / i386 / posix_fadvise64.S
blob3047b0d05c8dd7ab894075a703133ba98a25e9cf
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.
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.
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.
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/>.  */
19 #include <_lfs_64.h>
20 #include <sys/syscall.h>
22 #ifdef __NR_fadvise64_64
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
34         movl $__NR_fadvise64_64, %eax   /* Syscall number in %eax.  */
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
43         /* Do the system call trap.  */
44         int $0x80
46         /* Restore regs  */
47         popl    %edi
48         popl    %esi
49         popl    %ebx
50         popl    %ebp
52         /* Returns 0 on success, else an error code.  */
53         negl    %eax
55         /* Successful; return the syscall's value.  */
56         ret
57 .size posix_fadvise64,.-posix_fadvise64
58 #endif