summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-02-15 10:35:55 +0000
committerume <ume@FreeBSD.org>2001-02-15 10:35:55 +0000
commitbf66c2eda88095d4910d396920c45781fd19db78 (patch)
treefec467d8f011430483519c5b12d0778cc7154c94
parent126eb13f1ad3a376c386474ffbc2051157e8b493 (diff)
downloadFreeBSD-src-bf66c2eda88095d4910d396920c45781fd19db78.zip
FreeBSD-src-bf66c2eda88095d4910d396920c45781fd19db78.tar.gz
Correct 2nd argument of getnameinfo(3) to socklen_t.
Reviewed by: itojun
-rw-r--r--include/netdb.h17
-rw-r--r--lib/libc/net/getnameinfo.c2
-rw-r--r--sys/alpha/include/ansi.h1
-rw-r--r--sys/arm/include/ansi.h1
-rw-r--r--sys/i386/include/ansi.h1
-rw-r--r--sys/ia64/include/ansi.h1
-rw-r--r--sys/powerpc/include/ansi.h1
-rw-r--r--sys/sys/socket.h7
8 files changed, 27 insertions, 4 deletions
diff --git a/include/netdb.h b/include/netdb.h
index 4f34173..03b4f3e 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -61,8 +61,13 @@
#ifndef _NETDB_H_
#define _NETDB_H_
+#include <machine/ansi.h>
#include <sys/cdefs.h>
-#include <sys/types.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
#ifndef _PATH_HEQUIV
# define _PATH_HEQUIV "/etc/hosts.equiv"
@@ -192,6 +197,14 @@ struct addrinfo {
*/
#define SCOPE_DELIMITER '%'
+/*
+ * data types - basically forward decl for getnameinfo()
+ */
+#ifdef _BSD_SOCKLEN_T_
+typedef _BSD_SOCKLEN_T_ socklen_t;
+#undef _BSD_SOCKLEN_T_
+#endif
+
__BEGIN_DECLS
void endhostent __P((void));
void endnetent __P((void));
@@ -221,7 +234,7 @@ void setnetent __P((int));
void setprotoent __P((int));
int getaddrinfo __P((const char *, const char *,
const struct addrinfo *, struct addrinfo **));
-int getnameinfo __P((const struct sockaddr *, size_t, char *,
+int getnameinfo __P((const struct sockaddr *, socklen_t, char *,
size_t, char *, size_t, int));
void freeaddrinfo __P((struct addrinfo *));
char *gai_strerror __P((int));
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index 5bf2192..06d4d00 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -98,7 +98,7 @@ static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int));
int
getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
const struct sockaddr *sa;
- size_t salen;
+ socklen_t salen;
char *host;
size_t hostlen;
char *serv;
diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h
index be0e637..6acc404 100644
--- a/sys/alpha/include/ansi.h
+++ b/sys/alpha/include/ansi.h
@@ -54,6 +54,7 @@
#define _BSD_SSIZE_T_ long /* byte count or error */
#define _BSD_TIME_T_ int /* time() */
#define _BSD_TIMER_T_ int /* timer_t */
+#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t */
#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
diff --git a/sys/arm/include/ansi.h b/sys/arm/include/ansi.h
index b4a26a0..de5b4be 100644
--- a/sys/arm/include/ansi.h
+++ b/sys/arm/include/ansi.h
@@ -53,6 +53,7 @@
#define _BSD_SSIZE_T_ long /* byte count or error */
#define _BSD_TIME_T_ long /* time() */
#define _BSD_TIMER_T_ int /* timer_t */
+#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t */
#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index f01fe5e..b9bb2e4 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -55,6 +55,7 @@
#define _BSD_TIME_T_ long /* time()... */
#define _BSD_TIMER_T_ int /* timer_gettime()... */
#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
+#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t */
/*
* Types which are fundamental to the implementation and must be used
diff --git a/sys/ia64/include/ansi.h b/sys/ia64/include/ansi.h
index 8c23f34..eb88328 100644
--- a/sys/ia64/include/ansi.h
+++ b/sys/ia64/include/ansi.h
@@ -55,6 +55,7 @@
#define _BSD_VA_LIST_ __builtin_va_list /* va_list */
#define _BSD_CLOCKID_T_ int /* clockid_t */
#define _BSD_TIMER_T_ int /* timer_t */
+#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t */
/*
* Types which are fundamental to the implementation and must be used
diff --git a/sys/powerpc/include/ansi.h b/sys/powerpc/include/ansi.h
index ff43b39..8cc844e 100644
--- a/sys/powerpc/include/ansi.h
+++ b/sys/powerpc/include/ansi.h
@@ -53,6 +53,7 @@
#define _BSD_SSIZE_T_ long /* byte count or error */
#define _BSD_TIME_T_ long /* time() */
#define _BSD_TIMER_T_ int /* timer_t */
+#define _BSD_SOCKLEN_T_ __uint32_t /* socklen_t */
#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
#define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 2adbe39..f3a4fdc 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -48,8 +48,13 @@
/*
* Data types.
*/
+#include <machine/ansi.h>
+
typedef u_char sa_family_t;
-typedef u_int32_t socklen_t;
+#ifdef _BSD_SOCKLEN_T_
+typedef _BSD_SOCKLEN_T_ socklen_t;
+#undef _BSD_SOCKLEN_T_
+#endif
/*
* Types
OpenPOWER on IntegriCloud