chiark / gitweb /
Make run_directory.c stat the place it is going to try to run.
[elogind.git] / klibc / klibc / arch / i386 / socketcall.S
1 #
2 # socketcall.S
3 #
4 # On i386, the main (only?) user of socketcall(2), the memory array
5 # socketcall(2) needs is conveniently already assembled for us on
6 # the stack.  Capitalize on that to make a common socketcall stub.
7 #
8
9 #include <asm/unistd.h>
10
11 #ifdef __i386__
12
13         .text
14         .align 4
15         .globl __socketcall_common
16         .type __socketcall_common, @function
17
18 __socketcall_common:
19         pushl   %ebx
20
21         movzbl  %al,%ebx        # The socketcall number is passed in in %al
22         leal    8(%esp),%ecx    # Argument pointer
23         movl    $__NR_socketcall,%eax
24         int     $0x80
25         
26         cmpl    $-4096,%eax     # Error return?
27         
28         popl    %ebx
29         
30         jb      1f
31         
32         negl    %eax
33         movl    %eax,errno
34         orl     $-1,%eax        # Return -1
35 1:
36         ret
37
38         .size __socketcall_common,.-__socketcall_common
39         
40 #endif
41
42