Update.
[glibc.git] / sysdeps / unix / sysv / linux / i386 / s_pwrite64.S
blob6a1987b72e37c18fbc3729fa37ca832e3d3039e8
1 /* pwrite64 syscall for Linux/ix86.
2    Copyright (C) 1997 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 Library General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    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    Library General Public License for more details.
15    You should have received a copy of the GNU Library General Public
16    License along with the GNU C Library; see the file COPYING.LIB.  If not,
17    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18    Boston, MA 02111-1307, USA.  */
20 #include <sysdep.h>
22 /* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
23    more information about the value -4095 used below.*/
25         .text
26 ENTRY (__syscall_pwrite64)
28         PUSHARGS_5              /* Save register contents.  */
30         /* Load arguments.  This is unfortunately a little bit of a problem
31            since the kernel expects the arguments in a different order.  */
32         movl    0x20(%esp,1),%esi
33         movl    0x1c(%esp,1),%edi
34         movl    0x18(%esp,1),%edx
35         movl    0x14(%esp,1),%ecx
36         movl    0x10(%esp,1),%ebx
37         /* Load syscall number into %eax.  */
38         movl    $SYS_ify(pwrite), %eax
39         int     $0x80           /* Do the system call.  */
40         POPARGS_5               /* Restore register contents.  */
41         cmpl    $-4095, %eax    /* Check %eax for error.  */
42         jae     syscall_error   /* Jump to error handler if error.  */
43         ret                     /* Return to caller.  */
45 PSEUDO_END (__syscall_pwrite64)