1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
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. */
21 #include <socketcall.h>
23 #define P(a, b) P2(a, b)
28 #error NARGS not defined
34 /* The socket-oriented system calls are handled unusually in Linux.
35 They are all gated through the single `socketcall' system call number.
36 `socketcall' takes two arguments: the first is the subcode, specifying
37 which socket function is being called; and the second is a pointer to
38 the arguments to the specific function.
40 The .S files for the other calls just #define socket and #include this. */
43 #define __socket P(__,socket)
49 /* Drop up to 6 arguments (recvfrom) into the memory allocated by
50 the caller for varargs, since that's really what we have. */
51 st %o0, [%sp + 68 + 0]
52 st %o1, [%sp + 68 + 4]
54 st %o2, [%sp + 68 + 8]
56 st %o3, [%sp + 68 + 12]
58 st %o4, [%sp + 68 + 16]
60 st %o5, [%sp + 68 + 20]
66 mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */
67 add %sp, 68, %o1 /* arg 2: parameter block */
68 LOADSYSCALL(socketcall)
76 1: SYSCALL_ERROR_HANDLER
80 weak_alias (__socket, socket)