summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-01-09 00:50:29 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-01-09 00:50:29 +0000
commit0d5af6017e4549c8b622b505c6a7dd80b24df512 (patch)
tree71a17212ff1668a39c826fd64f1ecacdeba2f760
parent48bd7c118a25b950842864c7eb87ef666cbc342d (diff)
- (bal) Detect if clock_t structure exists, if not define it.
- (bal) Detect if O_NONBLOCK exists, if not define it. - (bal) removed news4-posix.h (now empty) - (bal) changed bsd-bindresvport.c and bsd-rresvport.c to use 'socklen_t' instead of 'int'
-rw-r--r--ChangeLog5
-rw-r--r--acconfig.h1
-rw-r--r--bsd-bindresvport.c2
-rw-r--r--bsd-rresvport.c2
-rw-r--r--configure.in14
-rw-r--r--defines.h10
-rw-r--r--includes.h1
-rw-r--r--next-posix.h3
8 files changed, 32 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b2118033..54b3ac85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,11 @@
- markus@cvs.openbsd.org 2001/01/08 21:48:17
[kex.c]
missing free; thanks stevesk@pobox.com
+ - (bal) Detect if clock_t structure exists, if not define it.
+ - (bal) Detect if O_NONBLOCK exists, if not define it.
+ - (bal) removed news4-posix.h (now empty)
+ - (bal) changed bsd-bindresvport.c and bsd-rresvport.c to use 'socklen_t'
+ instead of 'int'
20010108
- (bal) Fixed another typo in cli.c
diff --git a/acconfig.h b/acconfig.h
index 494c06f7..6f56deb0 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -236,6 +236,7 @@
#undef HAVE_SOCKLEN_T
#undef HAVE_SIZE_T
#undef HAVE_SSIZE_T
+#undef HAVE_CLOCK_T
#undef HAVE_MODE_T
#undef HAVE_PID_T
#undef HAVE_SA_FAMILY_T
diff --git a/bsd-bindresvport.c b/bsd-bindresvport.c
index fb3f6f2b..536a5056 100644
--- a/bsd-bindresvport.c
+++ b/bsd-bindresvport.c
@@ -62,7 +62,7 @@ bindresvport_af(sd, sa, af)
struct sockaddr_in6 *sin6;
u_int16_t *portp;
u_int16_t port;
- int salen;
+ socklen_t salen;
int i;
if (sa == NULL) {
diff --git a/bsd-rresvport.c b/bsd-rresvport.c
index e8f822bf..392768c0 100644
--- a/bsd-rresvport.c
+++ b/bsd-rresvport.c
@@ -59,7 +59,7 @@ rresvport_af(int *alport, sa_family_t af)
struct sockaddr *sa;
u_int16_t *portp;
int s;
- int salen;
+ socklen_t salen;
memset(&ss, '\0', sizeof ss);
sa = (struct sockaddr *)&ss;
diff --git a/configure.in b/configure.in
index dd68daeb..4730d3c4 100644
--- a/configure.in
+++ b/configure.in
@@ -694,6 +694,20 @@ if test "x$ac_cv_have_ssize_t" = "xyes" ; then
AC_DEFINE(HAVE_SSIZE_T)
fi
+AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
+ AC_TRY_COMPILE(
+ [
+#include <time.h>
+ ],
+ [ clock_t foo; foo = 1235; ],
+ [ ac_cv_have_clock_t="yes" ],
+ [ ac_cv_have_clock_t="no" ]
+ )
+])
+if test "x$ac_cv_have_clock_t" = "xyes" ; then
+ AC_DEFINE(HAVE_CLOCK_T)
+fi
+
AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
AC_TRY_COMPILE(
[
diff --git a/defines.h b/defines.h
index 45a187c1..593fcd64 100644
--- a/defines.h
+++ b/defines.h
@@ -47,6 +47,7 @@
#include <unistd.h> /* For STDIN_FILENO, etc */
#include <termios.h> /* Struct winsize */
+#include <fcntl.h> /* For O_NONBLOCK */
/* Constants */
@@ -88,6 +89,10 @@ enum
# define STDERR_FILENO 2
#endif
+#ifndef O_NONBLOCK /* Non Blocking Open */
+# define O_NONBLOCK 00004
+#endif
+
#ifndef S_ISREG
# define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
# define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
@@ -199,6 +204,11 @@ typedef int ssize_t;
# define HAVE_SSIZE_T
#endif /* HAVE_SSIZE_T */
+#ifndef HAVE_CLOCK_T
+typedef long clock_t;
+# define HAVE_CLOCK_T
+#endif; /* HAVE_CLOCK_T */
+
#ifndef HAVE_SA_FAMILY_T
typedef int sa_family_t;
# define HAVE_SA_FAMILY_T
diff --git a/includes.h b/includes.h
index c3309a50..96e97ca5 100644
--- a/includes.h
+++ b/includes.h
@@ -20,7 +20,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#include "config.h"
#include "next-posix.h"
-#include "news4-posix.h"
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/next-posix.h b/next-posix.h
index 92002060..3e16dacb 100644
--- a/next-posix.h
+++ b/next-posix.h
@@ -30,9 +30,6 @@
/* NeXT's readdir() is BSD (struct direct) not POSIX (struct dirent) */
#define dirent direct
-/* FILE */
-#define O_NONBLOCK 00004 /* non-blocking open */
-
/* Swap out NeXT's BSD wait() for a more POSIX complient one */
pid_t posix_wait(int *status);
#define wait(a) posix_wait(a)