posix_fadvise64.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <_lfs_64.h>
  16. #include <sys/syscall.h>
  17. #ifdef __NR_fadvise64_64
  18. .text
  19. .global posix_fadvise64
  20. .type posix_fadvise64,%function
  21. posix_fadvise64:
  22. /* Save regs */
  23. pushl %ebp
  24. pushl %ebx
  25. pushl %esi
  26. pushl %edi
  27. movl $__NR_fadvise64_64, %eax /* Syscall number in %eax. */
  28. movl 20(%esp), %ebx
  29. movl 24(%esp), %ecx
  30. movl 28(%esp), %edx
  31. movl 32(%esp), %esi
  32. movl 36(%esp), %edi
  33. movl 40(%esp), %ebp
  34. /* Do the system call trap. */
  35. int $0x80
  36. /* Restore regs */
  37. popl %edi
  38. popl %esi
  39. popl %ebx
  40. popl %ebp
  41. /* Returns 0 on success, else an error code. */
  42. negl %eax
  43. /* Successful; return the syscall's value. */
  44. ret
  45. .size posix_fadvise64,.-posix_fadvise64
  46. #endif