Change arity of OS_open_server_socket.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 3 Feb 1992 23:46:14 +0000 (23:46 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 3 Feb 1992 23:46:14 +0000 (23:46 +0000)
v7/src/microcode/uxsock.c
v7/src/microcode/uxsock.h

index ab05fb86963c8f0cb5cd4081f83da498a117067c..3093b686dff559eee4269493920868a57376f35e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsock.c,v 1.6 1992/01/20 17:18:50 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsock.c,v 1.7 1992/02/03 23:45:31 jinx Exp $
 
 Copyright (c) 1990-92 Massachusetts Institute of Technology
 
@@ -44,6 +44,7 @@ MIT in each case. */
 #endif
 #include "uxsock.h"
 #include "uxio.h"
+#include "prims.h"
 
 extern struct servent * EXFUN (getservbyname, (const char *, const char *));
 extern struct hostent * EXFUN (gethostbyname, (const char *));
@@ -130,9 +131,14 @@ DEFUN (OS_open_unix_stream_socket, (filename), CONST char * filename)
 #endif
 
 Tchannel
-DEFUN (OS_open_server_socket, (port), int port)
+DEFUN (OS_open_server_socket, (port, ArgNo), unsigned int port AND int ArgNo)
 {
   int s;
+
+  if (((sizeof (unsigned int)) >
+       (sizeof (((struct sockaddr_in *) 0)->sin_port))) &&
+      (port >= (1<<(CHAR_BIT * (((struct sockaddr_in *) 0)->sin_port)))))
+    error_bad_range_arg(ArgNo);    
   STD_UINT_SYSTEM_CALL
     (syscall_socket, s, (UX_socket (AF_INET, SOCK_STREAM, 0)));
   {
@@ -228,7 +234,7 @@ DEFUN (OS_open_unix_stream_socket, (filename), CONST char * filename)
 }
 
 Tchannel
-DEFUN (OS_open_server_socket, (port), int port)
+DEFUN (OS_open_server_socket, (port, ArgNo), unsigned int port AND int ArgNo)
 {
   error_unimplemented_primitive ();
   return (NO_CHANNEL);
index f62639aa6cfb5d33f3517b7159e6b46ae958c6b7..ce42a860f87835bdbbca6c411deedb754f94b811 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsock.h,v 1.2 1990/11/08 11:11:57 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsock.h,v 1.3 1992/02/03 23:46:14 jinx Exp $
 
-Copyright (c) 1990 Massachusetts Institute of Technology
+Copyright (c) 1990-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -48,7 +48,7 @@ extern char ** EXFUN (OS_get_host_by_name, (CONST char * host_name));
 extern Tchannel EXFUN (OS_open_unix_stream_socket, (CONST char * filename));
 #endif
 
-extern Tchannel EXFUN (OS_open_server_socket, (int port));
+extern Tchannel EXFUN (OS_open_server_socket, (unsigned int port, int ArgNo));
 extern Tchannel EXFUN
   (OS_server_connection_accept,
    (Tchannel channel, char * peer_host, int * peer_port));