Correct bugs in origin description.
[glibc.git] / sysdeps / unix / sysv / linux / i386 / s_pwrite64.S
blob89449b6fb51ab5fda3a8568aafa25f22fb12793e
1 /* pwrite64 syscall for Linux/ix86.
2    Copyright (C) 1997, 1998 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>
21 #include <asm/errno.h>
23 /* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for
24    more information about the value -4095 used below.*/
26         .text
27 ENTRY (__syscall_pwrite64)
29 #ifndef __NR_pwrite
30         movl    $-ENOSYS,%eax
31 # ifndef PIC
32         jmp     syscall_error
33 # endif
34 #else
36         PUSHARGS_5              /* Save register contents.  */
38         /* Load arguments.  This is unfortunately a little bit of a problem
39            since the kernel expects the arguments in a different order.  */
40         movl    0x20(%esp,1),%esi
41         movl    0x1c(%esp,1),%edi
42         movl    0x18(%esp,1),%edx
43         movl    0x14(%esp,1),%ecx
44         movl    0x10(%esp,1),%ebx
45         /* Load syscall number into %eax.  */
46         movl    $SYS_ify(pwrite), %eax
47         int     $0x80                   /* Do the system call.  */
48         POPARGS_5                       /* Restore register contents.  */
49         cmpl    $-4095, %eax            /* Check %eax for error.  */
50         jae     SYSCALL_ERROR_LABEL     /* Jump to error handler if error.  */
51 #endif
52 L(pseudo_end):
53         ret                     /* Return to caller.  */
55 PSEUDO_END (__syscall_pwrite64)