posix_fadvise64.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #include <_lfs_64.h>
  17. #include <sys/syscall.h>
  18. #ifdef __NR_fadvise64_64
  19. .text
  20. .global posix_fadvise64
  21. .type posix_fadvise64,%function
  22. posix_fadvise64:
  23. /* Save regs */
  24. pushl %ebp
  25. pushl %ebx
  26. pushl %esi
  27. pushl %edi
  28. movl $__NR_fadvise64_64, %eax /* Syscall number in %eax. */
  29. movl 20(%esp), %ebx
  30. movl 24(%esp), %ecx
  31. movl 28(%esp), %edx
  32. movl 32(%esp), %esi
  33. movl 36(%esp), %edi
  34. movl 40(%esp), %ebp
  35. /* Do the system call trap. */
  36. int $0x80
  37. /* Restore regs */
  38. popl %edi
  39. popl %esi
  40. popl %ebx
  41. popl %ebp
  42. /* Returns 0 on success, else an error code. */
  43. negl %eax
  44. /* Successful; return the syscall's value. */
  45. ret
  46. .size posix_fadvise64,.-posix_fadvise64
  47. #endif