mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 09:48:00 -04:00
115 lines
2.7 KiB
Plaintext
115 lines
2.7 KiB
Plaintext
$NetBSD: patch-ac,v 1.4 2006/06/21 14:27:28 minskim Exp $
|
|
|
|
--- nettest.c.orig 1992-11-05 21:52:58.000000000 +0000
|
|
+++ nettest.c
|
|
@@ -37,6 +37,7 @@ char copyright[] =
|
|
"@(#) Copyright 1992 Cray Research, Inc.\n\
|
|
All rights reserved.\n";
|
|
|
|
+#include <stdlib.h>
|
|
#define SRCRT
|
|
#include "nettest.h"
|
|
#ifdef BSD44
|
|
@@ -45,6 +46,9 @@ char copyright[] =
|
|
#if defined(BSD44) || defined(sun) || defined(ultrix) || defined(sgi)
|
|
#include <netinet/in_systm.h>
|
|
#endif
|
|
+#if defined(sgi)
|
|
+#include <sys/timeb.h>
|
|
+#endif
|
|
#include <sys/wait.h>
|
|
#include <sys/un.h>
|
|
#include <netinet/tcp.h>
|
|
@@ -92,8 +96,12 @@ int kbufsize = 0;
|
|
int nodelay = 0;
|
|
int mesghdr = 0;
|
|
|
|
+#if defined(BSD44) || defined(sgi)
|
|
+clock_t times();
|
|
+#else
|
|
long times();
|
|
-#if !defined(CRAY) && !defined(SYSV)
|
|
+#endif
|
|
+#if defined(sgi) || (!defined(CRAY) && !defined(SYSV))
|
|
#define GETTIMES(a, b) ftime(&a); times(&b);
|
|
#define TIMETYPE struct timeb
|
|
#else
|
|
@@ -126,7 +134,12 @@ struct sockaddr_iso to_s = {sizeof(to_s)
|
|
|
|
void do_children(), do_stream(), usage(), do_dgram(), prtimes();
|
|
|
|
-int read(), recv();
|
|
+int read();
|
|
+#if defined(sgi) && _NO_XOPEN4 && _NO_XOPEN5
|
|
+int recv();
|
|
+#else
|
|
+ssize_t recv();
|
|
+#endif
|
|
|
|
int (*rfunc)() = read;
|
|
|
|
@@ -550,7 +563,11 @@ main(argc, argv)
|
|
shutdown(s, 2);
|
|
exit(0);
|
|
}
|
|
+#ifdef BSD44
|
|
+ if (connect(s, (struct sockaddr *)&name, namesize) < 0) {
|
|
+#else
|
|
if (connect(s, (char *)&name, namesize) < 0) {
|
|
+#endif
|
|
perror("connect");
|
|
exit(1);
|
|
}
|
|
@@ -602,7 +619,6 @@ do_children(nconnections)
|
|
register int i;
|
|
int n;
|
|
struct children *childrenp;
|
|
- char *malloc();
|
|
int status, child_error = 0;
|
|
int notready = 0, nchildren;
|
|
struct tms tms1, tms2;
|
|
@@ -852,7 +868,7 @@ do_stream(in, out)
|
|
{
|
|
register int i, t, j, offset = 0, t2;
|
|
register char *cp;
|
|
- char buf[128], *data, *malloc(), *orgdata;
|
|
+ char buf[128], *data, *orgdata;
|
|
long *cnts;
|
|
register long *ldp;
|
|
struct tms tms1, tms2, tms3;
|
|
@@ -1135,7 +1151,6 @@ do_dgram(s)
|
|
{
|
|
register int ret, i;
|
|
register char *data;
|
|
- char *malloc();
|
|
struct tms tms1, tms2;
|
|
TIMETYPE start, end;
|
|
struct msghdr outmsg;
|
|
@@ -1160,8 +1175,8 @@ do_dgram(s)
|
|
*data = 0;
|
|
for (i = 0; i < nchunks; i++) {
|
|
ret = mesghdr ? sendmsg(s, &outmsg, 0)
|
|
- : sendto(s, data, chunksize, 0, (caddr_t)&name,
|
|
- namesize);
|
|
+ : sendto(s, data, chunksize, 0,
|
|
+ (struct sockaddr *)&name, namesize);
|
|
|
|
if (ret < 0) {
|
|
perror(mesghdr ? "sendmsg" : "sendto");
|
|
@@ -1397,12 +1412,13 @@ parsetos(name, proto)
|
|
register char *c;
|
|
int tos;
|
|
|
|
+#undef IP_TOS
|
|
#ifdef IP_TOS
|
|
struct tosent *tosp;
|
|
|
|
- tosp = gettosbyname(name, proto);
|
|
+ tosp = (struct tosent *)gettosbyname(name, proto);
|
|
if (tosp) {
|
|
- tos = tosp->t_tos;
|
|
+ tos = (int)tosp->t_tos;
|
|
} else {
|
|
#endif
|
|
for (c = name; *c; c++) {
|