aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-07-07 09:16:34 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-07-07 09:16:34 +0000
commit542143fc7bc0b0221651de6e4275f7bc39b2560d (patch)
tree7c7133a863ba8393d217b03c2a15b53482a75b9c
parent79c99f44349ebfbe3fadf15a1966aa7d41972975 (diff)
downloadnewlib-542143fc7bc0b0221651de6e4275f7bc39b2560d.zip
newlib-542143fc7bc0b0221651de6e4275f7bc39b2560d.tar.gz
newlib-542143fc7bc0b0221651de6e4275f7bc39b2560d.tar.bz2
* Merge HEAD into cv-branch.
-rw-r--r--winsup/cygwin/ChangeLog14
-rw-r--r--winsup/cygwin/Makefile.in19
-rw-r--r--winsup/cygwin/autoload.cc2
-rw-r--r--winsup/cygwin/net.cc45
4 files changed, 28 insertions, 52 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 45dfda9..0ca2601 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,17 @@
+2006-07-07 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o.
+ * autoload.cc (inet_addr): Drop definition.
+ (inet_ntoa): Ditto.
+ * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop.
+ (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa.
+ (cygwin_inet_addr): Remove here.
+ (cygwin_inet_aton): Ditto.
+ (cygwin_inet_network): Ditto.
+ * libc/inet_addr.c: New file implementing cygwin_inet_aton and
+ cygwin_inet_addr.
+ * libc/inet_network.c: New file implementing cygwin_inet_network.
+
2006-07-06 Christopher Faylor <cgf@timesys.com>
* hookapi.cc: Add comment header
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 38452e9..b2ca09a 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -133,15 +133,16 @@ DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \
fhandler_serial.o fhandler_socket.o fhandler_tape.o fhandler_termios.o \
fhandler_tty.o fhandler_virtual.o fhandler_windows.o fhandler_zero.o \
flock.o fnmatch.o fork.o fts.o ftw.o getopt.o glob.o grp.o heap.o \
- hookapi.o init.o ioctl.o ipc.o iruserok.o localtime.o lsearch.o \
- malloc_wrapper.o memmem.o miscfuncs.o mktemp.o mmap.o msg.o net.o netdb.o \
- nftw.o ntea.o passwd.o path.o pinfo.o pipe.o poll.o pthread.o regcomp.o \
- regerror.o regexec.o regfree.o registry.o resource.o rexec.o scandir.o \
- sched.o sec_acl.o sec_helper.o security.o select.o sem.o shared.o shm.o \
- sigfe.o signal.o sigproc.o smallprint.o spawn.o strace.o strptime.o \
- strsep.o strsig.o sync.o syscalls.o sysconf.o syslog.o termios.o thread.o \
- timelocal.o timer.o times.o tty.o uinfo.o uname.o v8_regexp.o \
- v8_regerror.o v8_regsub.o wait.o wincap.o window.o winf.o \
+ hookapi.o inet_addr.o inet_network.o init.o ioctl.o ipc.o iruserok.o \
+ localtime.o lsearch.o malloc_wrapper.o memmem.o miscfuncs.o mktemp.o \
+ mmap.o msg.o net.o netdb.o nftw.o ntea.o passwd.o path.o pinfo.o pipe.o \
+ poll.o pthread.o regcomp.o regerror.o regexec.o regfree.o registry.o \
+ resource.o rexec.o scandir.o sched.o sec_acl.o sec_helper.o security.o \
+ select.o sem.o shared.o shm.o sigfe.o signal.o sigproc.o smallprint.o \
+ spawn.o strace.o strptime.o strsep.o strsig.o sync.o syscalls.o \
+ sysconf.o syslog.o termios.o thread.o timelocal.o timer.o times.o tty.o \
+ uinfo.o uname.o v8_regexp.o v8_regerror.o v8_regsub.o wait.o wincap.o \
+ window.o winf.o \
$(EXTRA_DLL_OFILES) $(EXTRA_OFILES) $(MALLOC_OFILES) $(MT_SAFE_OBJECTS)
GMON_OFILES:=gmon.o mcount.o profil.o
diff --git a/winsup/cygwin/autoload.cc b/winsup/cygwin/autoload.cc
index 516757e..78dd692 100644
--- a/winsup/cygwin/autoload.cc
+++ b/winsup/cygwin/autoload.cc
@@ -475,8 +475,6 @@ LoadDLLfunc (getservbyname, 8, ws2_32)
LoadDLLfunc (getservbyport, 8, ws2_32)
LoadDLLfunc (getsockname, 12, ws2_32)
LoadDLLfunc (getsockopt, 20, ws2_32)
-LoadDLLfunc (inet_addr, 4, ws2_32)
-LoadDLLfunc (inet_ntoa, 4, ws2_32)
LoadDLLfunc (ioctlsocket, 12, ws2_32)
LoadDLLfunc (listen, 8, ws2_32)
LoadDLLfunc (recv, 16, ws2_32)
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 6391aee..3ff3638 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -49,6 +49,8 @@ extern "C"
int __stdcall rcmd (char **ahost, unsigned short inport, char *locuser,
char *remuser, char *cmd, SOCKET * fd2p);
int sscanf (const char *, const char *, ...);
+ int cygwin_inet_aton(const char *, struct in_addr *);
+ const char *cygwin_inet_ntop (int, const void *, char *, socklen_t);
} /* End of "C" section */
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
@@ -106,7 +108,8 @@ ntohs (unsigned short x)
extern "C" char *
cygwin_inet_ntoa (struct in_addr in)
{
- char *res = inet_ntoa (in);
+ char buf[20];
+ const char *res = cygwin_inet_ntop (AF_INET, &in, buf, sizeof buf);
if (_my_tls.locals.ntoa_buf)
{
@@ -118,46 +121,6 @@ cygwin_inet_ntoa (struct in_addr in)
return _my_tls.locals.ntoa_buf;
}
-/* exported as inet_addr: BSD 4.3 */
-extern "C" unsigned long
-cygwin_inet_addr (const char *cp)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return INADDR_NONE;
- unsigned long res = inet_addr (cp);
-
- return res;
-}
-
-/* exported as inet_aton: BSD 4.3
- inet_aton is not exported by wsock32 and ws2_32,
- so it has to be implemented here. */
-extern "C" int
-cygwin_inet_aton (const char *cp, struct in_addr *inp)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return 0;
-
- unsigned long res = inet_addr (cp);
-
- if (res == INADDR_NONE && strcmp (cp, "255.255.255.255"))
- return 0;
- if (inp)
- inp->s_addr = res;
- return 1;
-}
-
-extern "C" unsigned int
-cygwin_inet_network (const char *cp)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return INADDR_NONE;
- return ntohl (inet_addr (cp));
-}
-
/* inet_netof is in the standard BSD sockets library. It is useless
for modern networks, since it assumes network values which are no
longer meaningful, but some existing code calls it. */