summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-02-10 22:43:29 +0000
committerChristopher Faylor <me@cgf.cx>2003-02-10 22:43:29 +0000
commit407b8df695d94e88aa686d3ad84b0d6ccd363739 (patch)
tree2c1521fddf3a95c954419279a4330c4b5be3cf92 /winsup/cygwin/include
parenteff24ab9c5e61bc5e29df2a82f7f941ac9ce6927 (diff)
downloadcygnal-407b8df695d94e88aa686d3ad84b0d6ccd363739.tar.gz
cygnal-407b8df695d94e88aa686d3ad84b0d6ccd363739.tar.bz2
cygnal-407b8df695d94e88aa686d3ad84b0d6ccd363739.zip
* include/cygwin/in.h (in_attr_t): Define new type.
* include/arpa/inet.h (inet_addr): Change return type to in_addr_t. (inet_lnaof): Ditto. (inet_netof): Ditto. (inet_network): Ditto. * include/cygwin/types.h: Move many *_t typedefs here. Protect them with ifdefs. * fhandler_disk_file.cc (fhandler_disk_file::fstat): Change ntsec_atts to mode_t. * security.cc (get_attribute_from_acl): Accept mode_t attribute. (get_nt_attribute): Ditto. (get_file_attribute): Ditto. (get_nt_object_attribute): Ditto. (get_object_attribute): Ditto. * security.h: Reflect above changes. * syscalls.cc (chown_worker): Change attrib to mode_t.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r--winsup/cygwin/include/arpa/inet.h16
-rw-r--r--winsup/cygwin/include/cygwin/in.h121
-rw-r--r--winsup/cygwin/include/cygwin/types.h139
3 files changed, 202 insertions, 74 deletions
diff --git a/winsup/cygwin/include/arpa/inet.h b/winsup/cygwin/include/arpa/inet.h
index dc144d6b8..284e98e40 100644
--- a/winsup/cygwin/include/arpa/inet.h
+++ b/winsup/cygwin/include/arpa/inet.h
@@ -1,6 +1,6 @@
/* arpa/inet.h
- Copyright 1997, 1998, 2001 Red Hat, Inc.
+ Copyright 1997, 1998, 2001, 2002, 2003 Red Hat, Inc.
This file is part of Cygwin.
@@ -19,13 +19,13 @@ extern "C"
#endif
#ifndef __INSIDE_CYGWIN_NET__
-unsigned long inet_addr (const char *);
-int inet_aton (const char *, struct in_addr *);
-unsigned long inet_lnaof (struct in_addr);
-struct in_addr inet_makeaddr (unsigned long , unsigned long);
-unsigned int inet_netof (struct in_addr);
-unsigned int inet_network (const char *);
-char *inet_ntoa (struct in_addr);
+in_addr_t inet_addr (const char *);
+int inet_aton (const char *, struct in_addr *);
+in_addr_t inet_lnaof (struct in_addr);
+struct in_addr inet_makeaddr (unsigned long , unsigned long);
+in_addr_t inet_netof (struct in_addr);
+in_addr_t inet_network (const char *);
+char *inet_ntoa (struct in_addr);
#endif
#ifdef __cplusplus
diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygwin/in.h
index ff6952743..ed73b26db 100644
--- a/winsup/cygwin/include/cygwin/in.h
+++ b/winsup/cygwin/include/cygwin/in.h
@@ -21,7 +21,8 @@
#include <cygwin/types.h>
/* Standard well-defined IP protocols. */
-enum {
+enum
+{
IPPROTO_IP = 0, /* Dummy protocol for TCP */
IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
IPPROTO_IGMP = 2, /* Internet Gateway Management Protocol */
@@ -36,75 +37,77 @@ enum {
IPPROTO_MAX
};
+typedef uint16_t in_port_t;
/* Standard well-known ports. *//* from winsup/include/netinet/in.h */
enum
- {
- IPPORT_ECHO = 7, /* Echo service. */
- IPPORT_DISCARD = 9, /* Discard transmissions service. */
- IPPORT_SYSTAT = 11, /* System status service. */
- IPPORT_DAYTIME = 13, /* Time of day service. */
- IPPORT_NETSTAT = 15, /* Network status service. */
- IPPORT_FTP = 21, /* File Transfer Protocol. */
- IPPORT_TELNET = 23, /* Telnet protocol. */
- IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
- IPPORT_TIMESERVER = 37, /* Timeserver service. */
- IPPORT_NAMESERVER = 42, /* Domain Name Service. */
- IPPORT_WHOIS = 43, /* Internet Whois service. */
- IPPORT_MTP = 57,
-
- IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
- IPPORT_RJE = 77,
- IPPORT_FINGER = 79, /* Finger service. */
- IPPORT_TTYLINK = 87,
- IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
-
-
- IPPORT_EXECSERVER = 512, /* execd service. */
- IPPORT_LOGINSERVER = 513, /* rlogind service. */
- IPPORT_CMDSERVER = 514,
- IPPORT_EFSSERVER = 520,
-
- /* UDP ports. */
- IPPORT_BIFFUDP = 512,
- IPPORT_WHOSERVER = 513,
- IPPORT_ROUTESERVER = 520,
-
- /* Ports less than this value are reserved for privileged processes. */
- IPPORT_RESERVED = 1024,
-
- /* Ports greater this value are reserved for (non-privileged) servers. */
- IPPORT_USERRESERVED = 5000
- };
-
+{
+ IPPORT_ECHO = 7, /* Echo service. */
+ IPPORT_DISCARD = 9, /* Discard transmissions service. */
+ IPPORT_SYSTAT = 11, /* System status service. */
+ IPPORT_DAYTIME = 13, /* Time of day service. */
+ IPPORT_NETSTAT = 15, /* Network status service. */
+ IPPORT_FTP = 21, /* File Transfer Protocol. */
+ IPPORT_TELNET = 23, /* Telnet protocol. */
+ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
+ IPPORT_TIMESERVER = 37, /* Timeserver service. */
+ IPPORT_NAMESERVER = 42, /* Domain Name Service. */
+ IPPORT_WHOIS = 43, /* Internet Whois service. */
+ IPPORT_MTP = 57,
+
+ IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
+ IPPORT_RJE = 77,
+ IPPORT_FINGER = 79, /* Finger service. */
+ IPPORT_TTYLINK = 87,
+ IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
+
+
+ IPPORT_EXECSERVER = 512, /* execd service. */
+ IPPORT_LOGINSERVER = 513, /* rlogind service. */
+ IPPORT_CMDSERVER = 514,
+ IPPORT_EFSSERVER = 520,
+
+ /* UDP ports. */
+ IPPORT_BIFFUDP = 512,
+ IPPORT_WHOSERVER = 513,
+ IPPORT_ROUTESERVER = 520,
+
+ /* Ports less than this value are reserved for privileged processes. */
+ IPPORT_RESERVED = 1024,
+
+ /* Ports greater this value are reserved for (non-privileged) servers. */
+ IPPORT_USERRESERVED = 5000
+};
+typedef uint32_t in_addr_t;
/* Internet address. */
-struct in_addr {
- unsigned int s_addr;
+struct in_addr
+{
+ unsigned int s_addr;
};
/* Request struct for multicast socket ops */
struct ip_mreq
{
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
};
/* Structure describing an Internet (IP) socket address. */
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
-struct sockaddr_in {
- short int sin_family; /* Address family */
- unsigned short int sin_port; /* Port number */
- struct in_addr sin_addr; /* Internet address */
+struct sockaddr_in
+{
+ short int sin_family; /* Address family */
+ unsigned short int sin_port; /* Port number */
+ struct in_addr sin_addr; /* Internet address */
/* Pad to size of `struct sockaddr'. */
- unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
- sizeof(unsigned short int) - sizeof(struct in_addr)];
+ unsigned chari __pad[__SOCK_SIZE__ - sizeof(short int)
+ - sizeof(unsigned short int) - sizeof(struct in_addr)];
};
#define sin_zero __pad /* for BSD UNIX comp. -FvK */
-
/*
* Definitions of the bits in an Internet address integer.
* On subnets, host and network parts are found according
@@ -167,22 +170,18 @@ struct sockaddr_in {
#endif
-/*
- * IPv6 definitions as we start to include them. This is just
- * a beginning dont get excited 8)
- */
-
+/* IPv6 definitions as we start to include them. This is just
+ a beginning dont get excited 8) */
struct in6_addr
{
- unsigned char s6_addr[16];
+ unsigned char s6_addr[16];
};
struct sockaddr_in6
{
- unsigned short sin6_family;
- unsigned short sin6_port;
- unsigned long sin6_flowinfo;
- struct in6_addr sin6_addr;
+ unsigned short sin6_family;
+ unsigned short sin6_port;
+ unsigned long sin6_flowinfo;
+ struct in6_addr sin6_addr;
};
-
#endif /* _CYGWIN_IN_H */
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index 2064e8acb..c4ba3a656 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -19,8 +19,18 @@ extern "C"
#include <sys/sysmacros.h>
-typedef struct timespec timespec_t, timestruc_t;
-
+#ifndef __timespec_t_defined
+#define __timespec_t_defined
+typedef struct timespec timespec_t;
+#endif /*__timespec_t_defined*/
+
+#ifndef __timestruc_t_defined
+#define __timestruc_t_defined
+typedef struct timespec timestruc_t;
+#endif /*__timestruc_t_defined*/
+
+#ifndef __off_t_defined
+#define __off_t_defined
typedef long __off32_t;
typedef long long __off64_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
@@ -28,7 +38,10 @@ typedef __off64_t off_t;
#else
typedef __off32_t off_t;
#endif
+#endif /*__off_t_defined*/
+#ifndef __dev_t_defined
+#define __dev_t_defined
typedef short __dev16_t;
typedef unsigned long __dev32_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
@@ -36,9 +49,15 @@ typedef __dev32_t dev_t;
#else
typedef __dev16_t dev_t;
#endif
+#endif /*__dev_t_defined*/
+#ifndef __blksize_t_defined
+#define __blksize_t_defined
typedef long blksize_t;
+#endif /*__blksize_t_defined*/
+#ifndef __blkcnt_t_defined
+#define __blkcnt_t_defined
typedef long __blkcnt32_t;
typedef long long __blkcnt64_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
@@ -46,18 +65,128 @@ typedef __blkcnt64_t blkcnt_t;
#else
typedef __blkcnt32_t blkcnt_t;
#endif
+#endif /*__blkcnt_t_defined*/
+#ifndef __uid_t_defined
+#define __uid_t_defined
typedef unsigned short __uid16_t;
-typedef unsigned short __gid16_t;
typedef unsigned long __uid32_t;
-typedef unsigned long __gid32_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef __uid32_t uid_t;
-typedef __gid32_t gid_t;
#else
typedef __uid16_t uid_t;
+#endif
+#endif /*__uid_t_defined*/
+
+#ifndef __gid_t_defined
+#define __gid_t_defined
+typedef unsigned short __gid16_t;
+typedef unsigned long __gid32_t;
+#ifdef __CYGWIN_USE_BIG_TYPES__
+typedef __gid32_t gid_t;
+#else
typedef __gid16_t gid_t;
#endif
+#endif /*__gid_t_defined*/
+
+#ifndef __ino_t_defined
+#define __ino_t_defined
+#ifdef __CYGWIN_USE_BIG_TYPES1__
+typedef unsigned long long ino_t;
+#else
+typedef unsigned long ino_t;
+#endif
+#endif /*__ino_t_defined*/
+
+#ifndef __BIT_TYPES_DEFINED
+#define __BIT_TYPES_DEFINED__ 1
+
+#ifndef __vm_offset_t
+#define __vm_offset_t_defined
+typedef unsigned long vm_offset_t;
+#endif /*__vm_offset_t_defined*/
+
+#ifndef __vm_size_t
+#define __vm_size_t_defined
+typedef unsigned long vm_size_t;
+#endif /*__vm_size_t_defined*/
+
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef char int8_t;
+#endif
+#ifndef __int16_t_defined
+#define __int16_t_defined
+typedef __int16_t int16_t;
+#endif
+#ifndef __int32_t_defined
+#define __int32_t_defined
+typedef __int32_t int32_t;
+#endif
+#ifndef __int64_t_defined
+#define __int64_t_defined
+typedef __int64_t int64_t;
+#endif
+
+#ifndef __uint8_t_defined
+#define __uint8_t_defined
+typedef unsigned char uint8_t;
+#endif
+#ifndef __uint16_t_defined
+#define __uint16_t_defined
+typedef __uint16_t uint16_t;
+#endif
+#ifndef __uint32_t_defined
+#define __uint32_t_defined
+typedef __uint32_t uint32_t;
+#endif
+#ifndef __uint64_t_defined
+#define __uint64_t_defined
+typedef __uint64_t uint64_t;
+#endif
+
+#ifndef __uint8_t_defined
+#define __uint8_t_defined
+typedef unsigned char u_int8_t;
+#endif
+#ifndef __uint16_t_defined
+#define __uint16_t_defined
+typedef __uint16_t u_int16_t;
+#endif
+#ifndef __uint32_t_defined
+#define __uint32_t_defined
+typedef __uint32_t u_int32_t;
+#endif
+#ifndef __uint64_t_defined
+#define __uint64_t_defined
+typedef __uint64_t u_int64_t;
+#endif
+
+#ifndef __uintptr_t_defined
+#define __uintptr_t_defined
+typedef unsigned long uintptr_t;
+#endif
+
+#ifndef __intptr_t_defined
+#define __intptr_t_defined
+typedef long intptr_t;
+#endif
+
+#ifndef __register_t_defined
+#define __register_t_defined
+typedef __int32_t register_t;
+#endif
+
+#ifndef __addr_t_defined
+#define __addr_t_defined
+typedef char *addr_t;
+#endif
+
+#ifndef __mode_t_defined
+#define __mode_t_defined
+typedef unsigned mode_t;
+#endif
+#endif /*__BIT_TYPES_DEFINED*/
#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)