summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-06-11 07:21:21 +0000
committerdelphij <delphij@FreeBSD.org>2007-06-11 07:21:21 +0000
commit0325fb6ca4e8ecfa891d252d9d442141ad32847b (patch)
treed64971ce8313ba1ded2f2e6067ba93c54bc1e7ec /lib/libc/net
parent219bfe35e701b456e351b70d8d9b05418b7057d8 (diff)
downloadFreeBSD-src-0325fb6ca4e8ecfa891d252d9d442141ad32847b.zip
FreeBSD-src-0325fb6ca4e8ecfa891d252d9d442141ad32847b.tar.gz
Add inet_ntoa_r, a reentrant version of inet_ntoa. This is
available on a lot of platforms, as well as libkern for years. Submitted by: "MQ"
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/Makefile.inc2
-rw-r--r--lib/libc/net/inet.313
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc
index b9abe0f..3592f50 100644
--- a/lib/libc/net/Makefile.inc
+++ b/lib/libc/net/Makefile.inc
@@ -80,7 +80,7 @@ MLINKS+=if_indextoname.3 if_nametoindex.3 if_indextoname.3 if_nameindex.3 \
if_indextoname.3 if_freenameindex.3
MLINKS+=inet.3 addr.3 inet.3 inet_addr.3 inet.3 inet_aton.3 \
inet.3 inet_lnaof.3 inet.3 inet_makeaddr.3 inet.3 inet_netof.3 \
- inet.3 inet_network.3 inet.3 inet_ntoa.3 \
+ inet.3 inet_network.3 inet.3 inet_ntoa.3 inet.3 inet_ntoa_r.3\
inet.3 inet_ntop.3 inet.3 inet_pton.3 \
inet.3 network.3 inet.3 ntoa.3
MLINKS+= sctp_send.3 sctp_sendx.3
diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3
index d721d9e..d6428c9 100644
--- a/lib/libc/net/inet.3
+++ b/lib/libc/net/inet.3
@@ -28,7 +28,7 @@
.\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd March 21, 2007
+.Dd June 11, 2007
.Dt INET 3
.Os
.Sh NAME
@@ -36,6 +36,7 @@
.Nm inet_addr ,
.Nm inet_network ,
.Nm inet_ntoa ,
+.Nm inet_ntoa_r ,
.Nm inet_ntop ,
.Nm inet_pton ,
.Nm inet_makeaddr ,
@@ -57,6 +58,11 @@
.Fn inet_network "const char *cp"
.Ft char *
.Fn inet_ntoa "struct in_addr in"
+.Ft char *
+.Fo inet_ntoa_r
+.Fa "struct in_addr in"
+.Fa "char *buf"
+.Fc
.Ft const char *
.Fo inet_ntop
.Fa "int af"
@@ -147,6 +153,11 @@ string representing the address in
.Ql .\&
notation.
The routine
+.Fn inet_ntoa_r
+is the reentrant version of
+.Fn inet_ntoa .
+It requires a buffer large enough to contain an IPv4 address.
+The routine
.Fn inet_makeaddr
takes an Internet network number and a local
network address and constructs an Internet address
OpenPOWER on IntegriCloud