diff options
author | Robert Collins <rbtcollins@hotmail.com> | 2002-06-13 18:34:20 +0400 |
---|---|---|
committer | Robert Collins <rbtcollins@hotmail.com> | 2002-06-13 18:34:20 +0400 |
commit | 5db981e43b6fd700ca5b16e64468662b247a4ed5 (patch) | |
tree | e9ca06bd344662375321197afcc8671bcc8cd633 /winsup/cygwin/include | |
parent | 5eea0254c7a10b31f9c9b3f6339ce454d1d0a27c (diff) |
Merged changes from HEAD
Diffstat (limited to 'winsup/cygwin/include')
23 files changed, 436 insertions, 66 deletions
diff --git a/winsup/cygwin/include/cygwin/cygserver.h b/winsup/cygwin/include/cygwin/cygserver.h index 3751863f5..c7a04929f 100755 --- a/winsup/cygwin/include/cygwin/cygserver.h +++ b/winsup/cygwin/include/cygwin/cygserver.h @@ -1,6 +1,6 @@ /* cygserver.h - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Egor Duda <deo@logos-m.ru> diff --git a/winsup/cygwin/include/cygwin/cygserver_process.h b/winsup/cygwin/include/cygwin/cygserver_process.h index 4a49212b2..c8ff40b09 100755 --- a/winsup/cygwin/include/cygwin/cygserver_process.h +++ b/winsup/cygwin/include/cygwin/cygserver_process.h @@ -1,6 +1,6 @@ /* cygserver_process.h - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> diff --git a/winsup/cygwin/include/cygwin/cygserver_transport.h b/winsup/cygwin/include/cygwin/cygserver_transport.h index 1ed16edf7..493c9b530 100755 --- a/winsup/cygwin/include/cygwin/cygserver_transport.h +++ b/winsup/cygwin/include/cygwin/cygserver_transport.h @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> diff --git a/winsup/cygwin/include/cygwin/cygserver_transport_pipes.h b/winsup/cygwin/include/cygwin/cygserver_transport_pipes.h index 9afeebfef..9ebeee2a4 100755 --- a/winsup/cygwin/include/cygwin/cygserver_transport_pipes.h +++ b/winsup/cygwin/include/cygwin/cygserver_transport_pipes.h @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> diff --git a/winsup/cygwin/include/cygwin/cygserver_transport_sockets.h b/winsup/cygwin/include/cygwin/cygserver_transport_sockets.h index 94dc43e38..9881ca2bb 100755 --- a/winsup/cygwin/include/cygwin/cygserver_transport_sockets.h +++ b/winsup/cygwin/include/cygwin/cygserver_transport_sockets.h @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> diff --git a/winsup/cygwin/include/cygwin/grp.h b/winsup/cygwin/include/cygwin/grp.h index 3a58e2058..7dcae637d 100644 --- a/winsup/cygwin/include/cygwin/grp.h +++ b/winsup/cygwin/include/cygwin/grp.h @@ -35,8 +35,10 @@ struct __group32 char **gr_mem; }; -struct __group16 * getgrgid (__gid16_t gid); -struct __group16 * getgrnam (const char *name); +struct __group32 * getgrgid32 (__gid32_t gid); +struct __group32 * getgrnam32 (const char *name); +__gid32_t getgid32 (); +__gid32_t getegid32 (); #endif #ifdef __cplusplus diff --git a/winsup/cygwin/include/cygwin/ip.h b/winsup/cygwin/include/cygwin/ip.h deleted file mode 100644 index e4f23c753..000000000 --- a/winsup/cygwin/include/cygwin/ip.h +++ /dev/null @@ -1 +0,0 @@ -/* ip.h */ diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h index da747fd3d..b66c38f73 100644 --- a/winsup/cygwin/include/cygwin/socket.h +++ b/winsup/cygwin/include/cygwin/socket.h @@ -123,9 +123,11 @@ struct msghdr #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 @@ -148,8 +150,10 @@ struct msghdr #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 diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h index 90abc3999..5772a3754 100644 --- a/winsup/cygwin/include/cygwin/stat.h +++ b/winsup/cygwin/include/cygwin/stat.h @@ -19,20 +19,17 @@ extern "C" { #ifdef __INSIDE_CYGWIN__ struct __stat32 { - dev_t st_dev; + __dev16_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid16_t st_uid; __gid16_t st_gid; - dev_t st_rdev; + __dev16_t st_rdev; __off32_t st_size; - time_t st_atime; - long st_spare1; - time_t st_mtime; - long st_spare2; - time_t st_ctime; - long st_spare3; + timestruc_t st_atim; + timestruc_t st_mtim; + timestruc_t st_ctim; blksize_t st_blksize; __blkcnt32_t st_blocks; long st_spare4[2]; @@ -40,20 +37,17 @@ struct __stat32 struct __stat64 { - dev_t st_dev; + __dev32_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid32_t st_uid; __gid32_t st_gid; - dev_t st_rdev; + __dev32_t st_rdev; __off64_t st_size; - time_t st_atime; - long st_spare1; - time_t st_mtime; - long st_spare2; - time_t st_ctime; - long st_spare3; + timestruc_t st_atim; + timestruc_t st_mtim; + timestruc_t st_ctim; blksize_t st_blksize; __blkcnt64_t st_blocks; long st_spare4[2]; @@ -75,17 +69,18 @@ struct stat gid_t st_gid; dev_t st_rdev; off_t st_size; - time_t st_atime; - long st_spare1; - time_t st_mtime; - long st_spare2; - time_t st_ctime; - long st_spare3; + timestruc_t st_atim; + timestruc_t st_mtim; + timestruc_t st_ctim; blksize_t st_blksize; blkcnt_t st_blocks; long st_spare4[2]; }; +#define st_atime st_atim.tv_sec +#define st_mtime st_mtim.tv_sec +#define st_ctime st_ctim.tv_sec + #ifdef __cplusplus } #endif diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index 296a11a9c..69bfa2056 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -17,6 +17,10 @@ extern "C" #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H +#include <sys/sysmacros.h> + +typedef struct timespec timespec_t, timestruc_t; + typedef long __off32_t; typedef long long __off64_t; #ifdef __CYGWIN_USE_BIG_TYPES__ @@ -25,6 +29,14 @@ typedef __off64_t off_t; typedef __off32_t off_t; #endif +typedef short __dev16_t; +typedef unsigned long __dev32_t; +#ifdef __CYGWIN_USE_BIG_TYPES__ +typedef __dev32_t dev_t; +#else +typedef __dev16_t dev_t; +#endif + typedef long blksize_t; typedef long __blkcnt32_t; diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 5bf5663dc..6ab596e09 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -149,12 +149,14 @@ details. */ 49: Export setutent, endutent, utmpname, getutent, getutid, getutline. 50: Export fnmatch. 51: Export recvmsg, sendmsg. + 52: Export strptime + 53: Export strlcat, strlcpy. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 51 +#define CYGWIN_VERSION_API_MINOR 53 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/glob.h b/winsup/cygwin/include/glob.h index e6e648f11..6a393f004 100644 --- a/winsup/cygwin/include/glob.h +++ b/winsup/cygwin/include/glob.h @@ -66,9 +66,14 @@ typedef struct { int (*gl_lstat) __P((const char *, struct stat12 *)); int (*gl_stat) __P((const char *, struct stat12 *)); #else +#if defined (__INSIDE_CYGWIN__) + int (*gl_lstat) (); + int (*gl_stat) (); +#else int (*gl_lstat) __P((const char *, struct stat *)); int (*gl_stat) __P((const char *, struct stat *)); #endif +#endif } glob_t; #define GLOB_APPEND 0x0001 /* Append to output from previous call. */ diff --git a/winsup/cygwin/include/netinet/ip.h b/winsup/cygwin/include/netinet/ip.h index 33c59f87a..a8dac5b67 100644 --- a/winsup/cygwin/include/netinet/ip.h +++ b/winsup/cygwin/include/netinet/ip.h @@ -1,16 +1,199 @@ -/* netinet/ip.h +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.2 (Berkeley) 6/1/94 + * $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $ + */ - Copyright 1998, 2001 Red Hat, Inc. +#ifndef _NETINET_IP_H +#define _NETINET_IP_H -This file is part of Cygwin. +/* Added by Wu Yongwei */ +#ifndef LITTLE_ENDIAN +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 +#endif +#ifndef BYTE_ORDER +#define BYTE_ORDER LITTLE_ENDIAN +#endif -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ +#define IPVERSION 4 -#ifndef _NETINET_IP_H -#define _NETINET_IP_H +/* + * Structure of an internet header, naked of options. + */ +struct ip { +#ifdef _IP_VHL + u_char ip_vhl; /* version << 4 | header length >> 2 */ +#else +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ip_hl:4, /* header length */ + ip_v:4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ip_v:4, /* version */ + ip_hl:4; /* header length */ +#endif +#endif /* not _IP_VHL */ + u_char ip_tos; /* type of service */ + u_short ip_len; /* total length */ + u_short ip_id; /* identification */ + u_short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ + struct in_addr ip_src,ip_dst; /* source and dest address */ +}; + +#ifdef _IP_VHL +#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl)) +#define IP_VHL_HL(vhl) ((vhl) & 0x0f) +#define IP_VHL_V(vhl) ((vhl) >> 4) +#define IP_VHL_BORING 0x45 +#endif + +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for IP type of service (ip_tos) + */ +#ifndef IPTOS_LOWDELAY +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#endif +#define IPTOS_MINCOST 0x02 +/* ECN bits proposed by Sally Floyd */ +#define IPTOS_CE 0x01 /* congestion experienced */ +#define IPTOS_ECT 0x02 /* ECN-capable transport */ + + +/* + * Definitions for IP precedence (also in ip_tos) (hopefully unused) + */ +#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_INTERNETCONTROL 0xc0 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 + +/* + * Definitions for options. + */ +#define IPOPT_COPIED(o) ((o)&0x80) +#define IPOPT_CLASS(o) ((o)&0x60) +#define IPOPT_NUMBER(o) ((o)&0x1f) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_NOP 1 /* no operation */ + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SSRR 137 /* strict source route */ +#define IPOPT_RA 148 /* router alert */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +/* + * Time stamp option structure. + */ +struct ip_timestamp { + u_char ipt_code; /* IPOPT_TS */ + u_char ipt_len; /* size of structure (variable) */ + u_char ipt_ptr; /* index of current entry */ +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#endif + union ipt_timestamp { + n_long ipt_time[1]; + struct ipt_ta { + struct in_addr ipt_addr; + n_long ipt_time; + } ipt_ta[1]; + } ipt_timestamp; +}; + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ -#include <cygwin/ip.h> +#define IP_MSS 576 /* default maximum segment size */ -#endif /* _NETINET_IP_H */ +#endif diff --git a/winsup/cygwin/include/netinet/tcp.h b/winsup/cygwin/include/netinet/tcp.h index eef9a6116..9fcee6c71 100644 --- a/winsup/cygwin/include/netinet/tcp.h +++ b/winsup/cygwin/include/netinet/tcp.h @@ -1,16 +1,144 @@ -/* netinet/tcp.h +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp.h,v 1.13 2000/01/09 19:17:25 shin Exp $ + */ - Copyright 2000, 2001 Red Hat, Inc. +#ifndef _NETINET_TCP_H +#define _NETINET_TCP_H -This file is part of Cygwin. +/* Added by Wu Yongwei */ +#ifndef LITTLE_ENDIAN +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 +#endif +#ifndef BYTE_ORDER +#define BYTE_ORDER LITTLE_ENDIAN +#endif -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ +typedef u_int32_t tcp_seq; +typedef u_int32_t tcp_cc; /* connection count per rfc1644 */ -#ifndef _NETINET_TCP_H -#define _NETINET_TCP_H +#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ +#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ + +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +struct tcphdr { + u_short th_sport; /* source port */ + u_short th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +#if BYTE_ORDER == LITTLE_ENDIAN + u_int th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int th_off:4, /* data offset */ + th_x2:4; /* (unused) */ +#endif + u_char th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 +#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) -/* Maybe add some definitions, someday */ + u_short th_win; /* window */ + u_short th_sum; /* checksum */ + u_short th_urp; /* urgent pointer */ +}; + +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 /* Experimental */ +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ +#define TCPOPT_TSTAMP_HDR \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + +#define TCPOPT_CC 11 /* CC options: RFC-1644 */ +#define TCPOPT_CCNEW 12 +#define TCPOPT_CCECHO 13 +#define TCPOLEN_CC 6 +#define TCPOLEN_CC_APPA (TCPOLEN_CC+2) +#define TCPOPT_CC_HDR(ccopt) \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) + +/* + * Default maximum segment size for TCP. + * With an IP MSS of 576, this is 536, + * but 512 is probably more convenient. + * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). + */ +#define TCP_MSS 512 + +/* + * Default maximum segment size for TCP6. + * With an IP6 MSS of 1280, this is 1220, + * but 1024 is probably more convenient. (xxx kazu in doubt) + * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) + */ +#define TCP6_MSS 1024 + +#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ +#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ + +#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ + +#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ +#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) + /* max space left for options */ + +/* + * User-settable options (used with setsockopt). + */ +#ifndef TCP_NODELAY +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#define TCP_MAXSEG 0x02 /* set maximum segment size */ +#endif +#define TCP_NOPUSH 0x04 /* don't push last block of write */ +#define TCP_NOOPT 0x08 /* don't use TCP options */ #endif diff --git a/winsup/cygwin/include/pthread.h b/winsup/cygwin/include/pthread.h index 102ba650c..acdde4fc3 100644 --- a/winsup/cygwin/include/pthread.h +++ b/winsup/cygwin/include/pthread.h @@ -103,10 +103,20 @@ void pthread_cleanup_push (void (*routine)(void*), void *arg); void pthread_cleanup_pop (int execute); */ typedef void (*__cleanup_routine_type) (void *); - -#define pthread_cleanup_push(fn, arg) { __cleanup_routine_type __cleanup_routine=fn; \ -void *__cleanup_param=arg; -#define pthread_cleanup_pop(execute) if (execute) __cleanup_routine(__cleanup_param); } +typedef struct _pthread_cleanup_handler +{ + __cleanup_routine_type function; + void *arg; + struct _pthread_cleanup_handler *next; +} __pthread_cleanup_handler; + +void _pthread_cleanup_push (__pthread_cleanup_handler *handler); +void _pthread_cleanup_pop (int execute); + +#define pthread_cleanup_push(_fn, _arg) { __pthread_cleanup_handler __cleanup_handler = \ + { _fn, _arg, NULL }; \ + _pthread_cleanup_push( &__cleanup_handler ); +#define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute ); } /* Condition variables */ int pthread_cond_broadcast (pthread_cond_t *); diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index de3b3d4ea..f8feda4c7 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -1,6 +1,6 @@ /* sys/cygwin.h - Copyright 1997, 1998, 2000, 2001 Red Hat, Inc. + Copyright 1997, 1998, 2000, 2001, 2002 Red Hat, Inc. This file is part of Cygwin. @@ -69,7 +69,8 @@ typedef enum CW_GET_CYGWIN_REGISTRY_NAME, CW_STRACE_TOGGLE, CW_STRACE_ACTIVE, - CW_CYGWIN_PID_TO_WINPID + CW_CYGWIN_PID_TO_WINPID, + CW_EXTRACT_DOMAIN_AND_USER } cygwin_getinfo_types; #define CW_NEXTPID 0x80000000 // or with pid to get next one @@ -94,7 +95,7 @@ enum PID_USETTY = 0x1000, // Setting this enables or disables cygwin's // tty support. This is inherited by // all execed or forked processes. - PID_UNUSED2 = 0x2000, // child has execed + PID_ALLPIDS = 0x2000, // child has execed PID_EXECED = 0x4000, // redirect to original pid info block PID_NOREDIR = 0x8000, // don't redirect if execed PID_EXITED = 0x80000000 // Free entry. @@ -208,9 +209,15 @@ extern int cygwin_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD); #define TTY_CONSOLE 0x40000000 +#define EXTERNAL_PINFO_VERSION_16_BIT 0 +#define EXTERNAL_PINFO_VERSION_32_BIT 1 +#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_BIT + #ifndef _SYS_TYPES_H typedef unsigned short __uid16_t; typedef unsigned short __gid16_t; +typedef unsigned long __uid32_t; +typedef unsigned long __gid32_t; #endif struct external_pinfo @@ -233,9 +240,13 @@ struct external_pinfo char progname[MAX_PATH]; DWORD strace_mask; - HANDLE strace_file; + DWORD version; DWORD process_state; + + /* Only available if version >= EXTERNAL_PINFO_VERSION_32_BIT */ + __uid32_t uid32; + __gid32_t gid32; }; DWORD cygwin_internal (cygwin_getinfo_types, ...); diff --git a/winsup/cygwin/include/sys/ipc.h b/winsup/cygwin/include/sys/ipc.h index 8ddec6d50..c718a173a 100644 --- a/winsup/cygwin/include/sys/ipc.h +++ b/winsup/cygwin/include/sys/ipc.h @@ -39,9 +39,10 @@ struct ipc_perm { /* this is a value that will _never_ be a valid key from ftok */ #define IPC_PRIVATE -2 -#define IPC_RMID 0x0003 -#define IPC_SET 0x0002 -#define IPC_STAT 0x0001 +/* ctl commands 1000-1fff is ipc reserved */ +#define IPC_RMID 0x1003 +#define IPC_SET 0x1002 +#define IPC_STAT 0x1001 key_t ftok(const char *, int); diff --git a/winsup/cygwin/include/sys/mount.h b/winsup/cygwin/include/sys/mount.h index 00b7a0137..26e02cba2 100644 --- a/winsup/cygwin/include/sys/mount.h +++ b/winsup/cygwin/include/sys/mount.h @@ -21,10 +21,14 @@ enum MOUNT_BINARY = 0x002, /* "binary" format read/writes */ MOUNT_SYSTEM = 0x008, /* mount point came from system table */ MOUNT_EXEC = 0x010, /* Any file in the mounted directory gets 'x' bit */ - MOUNT_AUTO = 0x020, /* mount point refers to auto device mount */ + MOUNT_CYGDRIVE = 0x020, /* mount point refers to cygdriv device mount */ MOUNT_CYGWIN_EXEC = 0x040, /* file or directory is or contains a cygwin executable */ - MOUNT_MIXED = 0x080, /* reads are text, writes are binary */ + MOUNT_MIXED = 0x080, /* reads are text, writes are binary + not yet implemented */ + MOUNT_NOTEXEC = 0x100, /* don't check files for executable magic */ + MOUNT_DEVFS = 0x200, /* /device "filesystem" */ + MOUNT_PROC = 0x400 /* /proc "filesystem" */ }; int mount (const char *, const char *, unsigned __flags); diff --git a/winsup/cygwin/include/sys/strace.h b/winsup/cygwin/include/sys/strace.h index 955d77a1e..b43ab886f 100644 --- a/winsup/cygwin/include/sys/strace.h +++ b/winsup/cygwin/include/sys/strace.h @@ -44,7 +44,6 @@ public: int lmicrosec; int execing; int inited; - strace() : version(1) {} void hello (); void prntf (unsigned, const char *func, const char *, ...) /*__attribute__ ((regparm(3)))*/; void vprntf (unsigned, const char *func, const char *, va_list ap) /*__attribute__ ((regparm(3)))*/; diff --git a/winsup/cygwin/include/sys/sysmacros.h b/winsup/cygwin/include/sys/sysmacros.h index cc3a69160..2c9c69923 100644 --- a/winsup/cygwin/include/sys/sysmacros.h +++ b/winsup/cygwin/include/sys/sysmacros.h @@ -11,8 +11,14 @@ details. */ #ifndef _SYS_SYSMACROS_H #define _SYS_SYSMACROS_H +#ifdef __CYGWIN_USE_BIG_TYPES__ +#define major(dev) ((int)(((dev) >> 16) & 0xffff)) +#define minor(dev) ((int)((dev) & 0xffff)) +#define makedev(major, minor) (((major) << 16) | ((minor) & 0xffff)) +#else #define major(dev) ((int)(((dev) >> 8) & 0xff)) #define minor(dev) ((int)((dev) & 0xff)) -#define makedev(major, minor) (((major) << 8) | (minor)) +#define makedev(major, minor) (((major) << 8) | ((minor) & 0xff)) +#endif #endif /* _SYS_SYSMACROS_H */ diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h index a87f10627..c37776111 100644 --- a/winsup/cygwin/include/sys/termios.h +++ b/winsup/cygwin/include/sys/termios.h @@ -195,6 +195,14 @@ details. */ #define NCCS 18 +/* `c_cc' member of 'struct termios' structure can be disabled by + using the value _POSIX_VDISABLE. */ +#define _POSIX_VDISABLE '\0' + +/* Compare a character C to a value VAL from the `c_cc' array in a + `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ +#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) + typedef unsigned char cc_t; typedef unsigned int tcflag_t; typedef unsigned int speed_t; diff --git a/winsup/cygwin/include/sys/vfs.h b/winsup/cygwin/include/sys/vfs.h index f0f3eb96c..57b6f9232 100644 --- a/winsup/cygwin/include/sys/vfs.h +++ b/winsup/cygwin/include/sys/vfs.h @@ -12,7 +12,7 @@ details. */ #define _SYS_VFS_H_ struct statfs { - long f_type; /* type of filesystem (see below) */ + long f_type; /* type of filesystem */ long f_bsize; /* optimal transfer block size */ long f_blocks; /* total data blocks in file system */ long f_bfree; /* free blocks in fs */ diff --git a/winsup/cygwin/include/wchar.h b/winsup/cygwin/include/wchar.h index eabdaa725..bf3f017a2 100644 --- a/winsup/cygwin/include/wchar.h +++ b/winsup/cygwin/include/wchar.h @@ -16,6 +16,7 @@ details. */ /* Get wchar_t and wint_t from <stddef.h>. */ #define __need_wchar_t #define __need_wint_t +#define __need_size_t #include <stddef.h> __BEGIN_DECLS |