/* -*-C-*-
-$Id: pruxsock.c,v 1.22 2003/02/14 18:28:23 cph Exp $
+$Id: pruxsock.c,v 1.23 2006/11/22 18:50:41 cph Exp $
-Copyright (c) 1990-2001 Massachusetts Institute of Technology
+Copyright 1990,1991,1992,1993,1996,1997 Massachusetts Institute of Technology
+Copyright 1998,1999,2000,2001,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
return (STRING_LOC ((ARG_REF (arg)), 0));
}
+static Tchannel
+DEFUN (arg_client_socket, (arg), unsigned int arg)
+{
+ Tchannel socket = (arg_nonnegative_integer (arg));
+ if (! (((OS_channel_type (socket)) == channel_type_tcp_stream_socket)
+ || ((OS_channel_type (socket)) == channel_type_unix_stream_socket)))
+ error_bad_range_arg (arg);
+ return (socket);
+}
+
static Tchannel
DEFUN (arg_server_socket, (arg), unsigned int arg)
{
#endif
PRIMITIVE_RETURN (SHARP_T);
}
+
+DEFINE_PRIMITIVE ("SHUTDOWN-SOCKET", Prim_shutdown_socket, 2, 2, "")
+{
+ PRIMITIVE_HEADER (2);
+ OS_shutdown_socket ((arg_client_socket (1)),
+ (arg_integer_in_range (2, 1, 4)));
+ PRIMITIVE_RETURN (UNSPECIFIC);
+}
\f
DEFINE_PRIMITIVE ("NEW-OPEN-TCP-SERVER-SOCKET", Prim_new_open_tcp_server_socket, 2, 2,
"Given PORT-NUMBER, open TCP server socket.\n\
/* -*-C-*-
-$Id: syscall.h,v 1.17 2003/07/09 22:53:51 cph Exp $
+$Id: syscall.h,v 1.18 2006/11/22 18:50:43 cph Exp $
Copyright 1993,1994,1995,1996,1997,1999 Massachusetts Institute of Technology
-Copyright 2000,2003 Massachusetts Institute of Technology
+Copyright 2000,2003,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
*/
-/* OS system calls and errors.
- Must match utabmd.scm
- */
+/* OS system calls and errors. */
#ifndef SCM_SYSCALL_H
-#define SCM_SYSCALL_H
+#define SCM_SYSCALL_H 1
#include "config.h"
\f
#else /* not __WIN32__ */
+/* Unix case, inline for historical reasons. Must match "uxtop.c". */
+
enum syscall_names
{
syscall_accept,
syscall_select,
syscall_setitimer,
syscall_setpgid,
+ syscall_shutdown,
syscall_sighold,
syscall_sigprocmask,
syscall_sigsuspend,
/* -*-C-*-
-$Id: uxsock.c,v 1.31 2003/07/09 22:53:38 cph Exp $
+$Id: uxsock.c,v 1.32 2006/11/22 18:50:44 cph Exp $
Copyright 1993,1996,1997,1998,1999,2000 Massachusetts Institute of Technology
-Copyright 2001,2003 Massachusetts Institute of Technology
+Copyright 2001,2003,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
}
}
+void
+DEFUN (OS_shutdown_socket, (channel, stype),
+ Tchannel channel AND
+ unsigned long stype)
+{
+ STD_VOID_SYSTEM_CALL
+ (syscall_shutdown,
+ (shutdown ((CHANNEL_DESCRIPTOR (channel)),
+ (((stype & 0x3) == 0x1)
+ ? SHUT_RD
+ : ((stype & 0x3) == 0x2)
+ ? SHUT_WR
+ : SHUT_RDWR))));
+}
+
int
DEFUN (OS_get_service_by_name, (service_name, protocol_name),
CONST char * service_name AND
/* -*-C-*-
-$Id: uxsock.h,v 1.12 2003/02/14 18:28:24 cph Exp $
+$Id: uxsock.h,v 1.13 2006/11/22 18:50:46 cph Exp $
-Copyright (c) 1990-2001 Massachusetts Institute of Technology
+Copyright 1990,1992,1993,1997,1998,1999 Massachusetts Institute of Technology
+Copyright 2001,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
#include "osio.h"
extern Tchannel EXFUN (OS_open_tcp_stream_socket, (PTR, unsigned int));
+extern void EXFUN (OS_shutdown_socket, (Tchannel, unsigned long));
extern int EXFUN (OS_get_service_by_name, (CONST char *, CONST char *));
extern unsigned long EXFUN (OS_get_service_by_number, (CONST unsigned long));
extern unsigned int EXFUN (OS_host_address_length, (void));
/* -*-C-*-
-$Id: uxtop.c,v 1.30 2003/07/09 22:53:55 cph Exp $
+$Id: uxtop.c,v 1.31 2006/11/22 18:50:48 cph Exp $
Copyright 1990,1991,1992,1993,1994,1995 Massachusetts Institute of Technology
Copyright 1996,1997,1999,2000,2002,2003 Massachusetts Institute of Technology
+Copyright 2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
"select",
"setitimer",
"setpgid",
+ "shutdown",
"sighold",
"sigprocmask",
"sigsuspend",