$NetBSD: patch-ac,v 1.3 2004/08/22 23:27:16 jschauma Exp $ --- nettest.c.orig 1992-11-05 16:52:58.000000000 -0500 +++ nettest.c 2004-08-22 19:25:48.000000000 -0400 @@ -45,6 +45,9 @@ #if defined(BSD44) || defined(sun) || defined(ultrix) || defined(sgi) #include #endif +#if defined(sgi) +#include +#endif #include #include #include @@ -92,8 +95,12 @@ 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 +133,12 @@ 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 +562,11 @@ 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); } @@ -1160,8 +1176,8 @@ *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 +1413,13 @@ 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++) {