summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2003-03-09 16:45:20 +0000
committerChristopher Faylor <cgf@redhat.com>2003-03-09 16:45:20 +0000
commit1f11ea1c09c9d7378f06d1970aeaa9345d40c977 (patch)
tree3238aa43737ca6a4746937706b11a7349c7d8a36
parent0040737d97da833819963b4a775115a021f8a4eb (diff)
downloadgdb-1f11ea1c09c9d7378f06d1970aeaa9345d40c977.tar.gz
merge from trunk
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/Makefile.in36
-rw-r--r--winsup/cygwin/include/cygwin/socket.h169
3 files changed, 188 insertions, 21 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ec0bc21287f..1d027672022 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/socket.h: Set SOMAXCONN to Winsock2 value.
+
2003-03-08 Christopher Faylor <cgf@redhat.com>
* syscalls.cc (unlink): Always attempt to use FILE_FLAG_CLOSE_ON_DELETE
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index cb5c39db33d..f8507ede312 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -49,7 +49,6 @@ DEFS:=@DEFS@
# cygheap_CFLAGS:=-fomit-frame-pointer
malloc_CFLAGS:=-fomit-frame-pointer
-malloc_wrapper_CFLAGS:=-fomit-frame-pointer
shared_CFLAGS:=-fomit-frame-pointer
cygthread_CFLAGS:=-fomit-frame-pointer
miscfuncs_CFLAGS:=-fomit-frame-pointer
@@ -115,12 +114,14 @@ RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
RUNTESTFLAGS =
# Parameters used in building the cygwin.dll.
-# We build as new-cygwin.dll and rename at install time to overcome
+# We build as cygwin0.dll and rename at install time to overcome
# native rebuilding issues (we don't want the build tools to see a partially
# built cygwin.dll and attempt to use it instead of the old one).
DLL_NAME:=cygwin1.dll
+TEST_DLL_NAME:=cygwin0.dll
LIB_NAME:=libcygwin.a
+TEST_LIB_NAME:=libcygwin0.a
DEF_FILE:=cygwin.def
DLL_ENTRY:=@DLL_ENTRY@
@@ -144,17 +145,16 @@ MALLOC_OFILES=@MALLOC_OFILES@
DLL_IMPORTS:=$(w32api_lib)/libkernel32.a
-MT_SAFE_OBJECTS:=
# Please maintain this list in sorted order, with maximum files per 80 col line
DLL_OFILES:=assert.o autoload.o cxx.o cygheap.o cygserver_client.o \
cygserver_transport.o cygserver_transport_pipes.o \
cygserver_transport_sockets.o cygthread.o dcrt0.o debug.o \
- delqueue.o devices.o dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o \
+ delqueue.o dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o \
exceptions.o exec.o external.o fcntl.o fhandler.o \
fhandler_clipboard.o fhandler_console.o fhandler_disk_file.o \
- fhandler_dsp.o fhandler_fifo.o fhandler_floppy.o fhandler_mem.o \
- fhandler_nodevice.o fhandler_proc.o fhandler_process.o \
- fhandler_random.o fhandler_raw.o fhandler_registry.o fhandler_serial.o \
+ fhandler_dsp.o fhandler_floppy.o fhandler_mem.o \
+ fhandler_proc.o fhandler_process.o fhandler_random.o \
+ fhandler_raw.o fhandler_registry.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 fnmatch.o fork.o glob.o grp.o heap.o init.o ioctl.o \
@@ -196,7 +196,7 @@ all: all_target $(all_host)
all_target: $(TARGET_LIBS) cygserver.exe
-all_host: new-$(LIB_NAME)
+all_host: $(TEST_LIB_NAME)
force:
@@ -206,7 +206,7 @@ install: install-libs install-headers install-man install_target \
uninstall: uninstall-libs uninstall-headers uninstall-man
install-libs: $(TARGET_LIBS)
- $(INSTALL_DATA) new-$(DLL_NAME) $(bindir)/$(DLL_NAME); \
+ $(INSTALL_DATA) $(TEST_DLL_NAME) $(bindir)/$(DLL_NAME); \
for i in $^; do \
$(INSTALL_DATA) $$i $(tooldir)/lib/`basename $$i` ; \
done
@@ -281,26 +281,25 @@ maintainer-clean realclean: clean
# Rule to build cygwin.dll
-new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
+$(TEST_DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
$(CXX) $(CXXFLAGS) -nostdlib -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \
-e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
$(MALLOC_OBJ) $(LIBM) $(LIBC) \
-lgcc $(DLL_IMPORTS)
+ @ln $@ new-$(DLL_NAME)
# Rule to build libcygwin.a
-$(LIB_NAME): rmsym newsym new-$(DLL_NAME) $(LIBCOS)
+$(LIB_NAME): rmsym newsym $(TEST_DLL_NAME) $(LIBCOS)
/bin/sh ${word 1,$^} ./cygdll.a "$(NM)" "$(AR)" "$(RANLIB)" $(OBSOLETE_FUNCTIONS) || exit 0
/bin/sh ${word 2,$^} ./cygdll.a "$(AS)" "$(AR)" "$(RANLIB)" $(NEW_FUNCTIONS) || exit 0
(echo create $(LIB_NAME); echo addmod $(LIBCOS); echo addlib cygdll.a; echo save) | $(AR) -M
+ $(RANLIB) $@
# Rule to make stub library used by testsuite
# dependency set to $(LIB_NAME) to accommodate make -j2.
# Otherwise dlltool gets confused. cgf (11-16-2000)
-new-$(LIB_NAME): $(LIB_NAME)
- $(DLLTOOL) --as=$(AS) --dllname new-$(DLL_NAME) --def $(DEF_FILE) --output-lib new-templib.a
- $(AR) rcv new-templib.a $(LIBCOS)
- mv new-templib.a new-$(LIB_NAME)
- $(RANLIB) $@
+$(TEST_LIB_NAME): $(LIB_NAME)
+ perl -p -e 'BEGIN{binmode(STDIN); binmode(STDOUT);}; s/cygwin1/cygwin0/g' < $? > $@
dll_ofiles: $(DLL_OFILES)
@@ -354,11 +353,6 @@ cygserver_transport_sockets_outside.o: cygserver_transport_sockets.cc
cygserver_client_outside.o: cygserver_client.cc
$(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $<
-# gperf -c --key-positions='1-126' -r -t -C -E -L 'ANSI-C' -Hdevhash -N'device::lookup' -Z devstring -7 $? |\
-
-$(srcdir)/devices.cc: cygwin-gperf devices.gperf devices.h
- $^ > $@
-
cygserver.exe: cygserver.o cygserver_shm.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o
$(CXX) -o $@ $^ -lstdc++
#ifdef VERBOSE
diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h
new file mode 100644
index 00000000000..f89a8ed8726
--- /dev/null
+++ b/winsup/cygwin/include/cygwin/socket.h
@@ -0,0 +1,169 @@
+/* cygwin/socket.h
+
+ Copyright 1999, 2000, 2001 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _CYGWIN_SOCKET_H
+#define _CYGWIN_SOCKET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+struct sockaddr {
+ unsigned short sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+#include <asm/socket.h> /* arch-dependent defines */
+#include <cygwin/sockios.h> /* the SIOCxxx I/O controls */
+#include <cygwin/uio.h> /* iovec support */
+#include <sys/types.h>
+
+struct linger {
+ unsigned short l_onoff; /* Linger active */
+ unsigned short l_linger; /* How long to linger for */
+};
+
+struct msghdr
+{
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ int msg_iovlen; /* Number of blocks */
+ void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
+ int msg_accrightslen; /* Length of rights list */
+};
+
+#ifndef socklen_t
+#define socklen_t int
+#endif
+
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+
+/* Supported address families. */
+/*
+ * Address families.
+ */
+#define AF_UNSPEC 0 /* unspecified */
+#define AF_UNIX 1 /* local to host (pipes, portals) */
+#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
+#define AF_IMPLINK 3 /* arpanet imp addresses */
+#define AF_PUP 4 /* pup protocols: e.g. BSP */
+#define AF_CHAOS 5 /* mit CHAOS protocols */
+#define AF_NS 6 /* XEROX NS protocols */
+#define AF_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO /* OSI is ISO */
+#define AF_ECMA 8 /* european computer manufacturers */
+#define AF_DATAKIT 9 /* datakit protocols */
+#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
+#define AF_SNA 11 /* IBM SNA */
+#define AF_DECnet 12 /* DECnet */
+#define AF_DLI 13 /* Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* AppleTalk */
+#define AF_NETBIOS 17 /* NetBios-style addresses */
+#define AF_INET6 23 /* IP version 6 */
+
+#define AF_MAX 32
+/*
+ * Protocol families, same as address families for now.
+ */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_LOCAL AF_LOCAL
+#define PF_INET AF_INET
+#define PF_IMPLINK AF_IMPLINK
+#define PF_PUP AF_PUP
+#define PF_CHAOS AF_CHAOS
+#define PF_NS AF_NS
+#define PF_ISO AF_ISO
+#define PF_OSI AF_OSI
+#define PF_ECMA AF_ECMA
+#define PF_DATAKIT AF_DATAKIT
+#define PF_CCITT AF_CCITT
+#define PF_SNA AF_SNA
+#define PF_DECnet AF_DECnet
+#define PF_DLI AF_DLI
+#define PF_LAT AF_LAT
+#define PF_HYLINK AF_HYLINK
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETBIOS AF_NETBIOS
+#define PF_INET6 AF_INET6
+
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specificable by listen. */
+#define SOMAXCONN 0x7fffffff
+
+/* Flags we can use with send/ and recv. */
+#define MSG_OOB 0x1 /* process out-of-band data */
+#define MSG_PEEK 0x2 /* peek at incoming message */
+#define MSG_DONTROUTE 0x4 /* send without using routing tables */
+#define MSG_WINMASK 0x7 /* flags understood by WinSock calls */
+#define MSG_NOSIGNAL 0x20 /* Don't raise SIGPIPE */
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_IP 0
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_TCP 6
+#define SOL_UDP 17
+
+/* IP options */
+#ifndef IPTOS_LOWDELAY
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#endif
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* IP options for use with WinSock */
+
+#define IP_OPTIONS 1
+#define IP_MULTICAST_IF 2
+#define IP_MULTICAST_TTL 3
+#define IP_MULTICAST_LOOP 4
+#define IP_ADD_MEMBERSHIP 5
+#define IP_DROP_MEMBERSHIP 6
+#define IP_TTL 7
+#define IP_TOS 8
+#define IP_DONTFRAGMENT 9
+
+/* IPX options */
+#define IPX_TYPE 1
+
+/* TCP options - this way around because someone left a set in the c library includes */
+#ifndef TCP_NODELAY
+#define TCP_NODELAY 0x0001
+#define TCP_MAXSEG 2
+#endif
+
+/* The various priorities. */
+#define SOPRI_INTERACTIVE 0
+#define SOPRI_NORMAL 1
+#define SOPRI_BACKGROUND 2
+
+#ifdef __cplusplus
+};
+#endif /* __cplusplus */
+
+#endif /* _CYGWIN_SOCKET_H */