1 /* Copyright 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Alexandre Oliva <aoliva@redhat.com>.
4 Based on ../i386/socket.S.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 #include <socketcall.h>
24 #define P(a, b) P2(a, b)
28 /* The socket-oriented system calls are handled unusally in Linux.
29 They are all gated through the single `socketcall' system call number.
30 `socketcall' takes two arguments: the first is the subcode, specifying
31 which socket function is being called; and the second is a pointer to
32 the arguments to the specific function.
34 The .S files for the other calls just #define socket and #include this. */
38 #define __socket P(__,socket)
40 #define __socket socket
50 mov SYS_ify(socketcall),d0 /* System call number in d0. */
52 /* Use ## so `socket' is a separate token that might be #define'd. */
53 mov P(SOCKOP_,socket),a0 /* Subcode is first arg to syscall. */
55 add 4,d1 /* Address of args is 2nd arg. */
57 /* Do the system call trap. */
60 /* d0 is < 0 if there was an error. */
63 jmp SYSCALL_ERROR_LABEL
65 /* Successful; return the syscall's value. */
72 weak_alias (__socket, socket)