summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/posix_fadvise64.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/i386/posix_fadvise64.S')
-rw-r--r--libc/sysdeps/linux/i386/posix_fadvise64.S68
1 files changed, 14 insertions, 54 deletions
diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S
index da3f36394..3047b0d05 100644
--- a/libc/sysdeps/linux/i386/posix_fadvise64.S
+++ b/libc/sysdeps/linux/i386/posix_fadvise64.S
@@ -13,20 +13,18 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
-#define _ERRNO_H 1
-#include <features.h>
-#include <bits/errno.h>
+#include <_lfs_64.h>
#include <sys/syscall.h>
+#ifdef __NR_fadvise64_64
+
.text
.global posix_fadvise64
.type posix_fadvise64,%function
posix_fadvise64:
-#if defined __NR_fadvise64_64 && defined __UCLIBC_HAS_LFS__
/* Save regs */
pushl %ebp
pushl %ebx
@@ -35,12 +33,12 @@ posix_fadvise64:
movl $__NR_fadvise64_64, %eax /* Syscall number in %eax. */
- movl 24(%esp), %ebx
- movl 28(%esp), %ecx
- movl 32(%esp), %edx
- movl 36(%esp), %esi
- movl 40(%esp), %edi
- movl 44(%esp), %ebp
+ movl 20(%esp), %ebx
+ movl 24(%esp), %ecx
+ movl 28(%esp), %edx
+ movl 32(%esp), %esi
+ movl 36(%esp), %edi
+ movl 40(%esp), %ebp
/* Do the system call trap. */
int $0x80
@@ -51,48 +49,10 @@ posix_fadvise64:
popl %ebx
popl %ebp
- /* If 0 > %eax > -4096 there was an error. */
- cmpl $-4096, %eax
- ja __syscall_error
-#elif defined __NR_fadvise64
- /* Save regs */
- pushl %ebx
- pushl %esi
- pushl %edi
-
- /* does len overflow long? */
- cmpl $0, 40(%esp)
- movl $-EOVERFLOW, %eax
- ja overflow
+ /* Returns 0 on success, else an error code. */
+ negl %eax
- movl $__NR_fadvise64, %eax /* Syscall number in %eax. */
-
- movl 24(%esp), %ebx
- movl 28(%esp), %ecx
- movl 32(%esp), %edx
- movl 36(%esp), %esi
- movl 44(%esp), %edi
-
- /* Do the system call trap. */
- int $0x80
-overflow:
- /* Restore regs */
- popl %edi
- popl %esi
- popl %ebx
-
- /* If 0 > %eax > -4096 there was an error. */
- cmpl $-4096, %eax
- ja __syscall_error
-
-#elif defined __UCLIBC_HAS_STUBS__
- movl $-ENOSYS, %eax
- jmp __syscall_error
-#endif
/* Successful; return the syscall's value. */
ret
-
.size posix_fadvise64,.-posix_fadvise64
-
-libc_hidden_def(posix_fadvise64)
-
+#endif