aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/include
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-09-28 19:02:53 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-09-28 19:02:53 +0000
commit1204c515fe00335920c5707cc136e9562fd7cf38 (patch)
tree4769da39e77da4b6be69ba926c23e75faa68af82 /winsup/cygwin/include
parent280fdd0b67c3dbd3cee12bf6dbe363f222d98342 (diff)
downloadnewlib-1204c515fe00335920c5707cc136e9562fd7cf38.zip
newlib-1204c515fe00335920c5707cc136e9562fd7cf38.tar.gz
newlib-1204c515fe00335920c5707cc136e9562fd7cf38.tar.bz2
* fhandler.h (class fhandler_dev_raw): Delete current_position and
eof_detected status flag. Delete is_eom and is_eof methods. Move drive_size, bytes_per_sector, eom_detected status flag, as well as the methods read_file, write_file, raw_read and raw_write to ... (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof methods. Add dup method. * fhandler_floppy.cc (IS_EOM): New macro. (fhandler_dev_floppy::is_eom): Remove. (fhandler_dev_floppy::is_eof): Remove. (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. (fhandler_dev_floppy::get_drive_info): Only call EX functions on systems supporting them and stop suffering strange delays. (fhandler_dev_floppy::read_file): Move here, drop setting current_position. (fhandler_dev_floppy::write_file): Move here, drop setting current_position. (fhandler_dev_floppy::open): Rearrange comment. (fhandler_dev_floppy::dup): New method. (fhandler_dev_floppy::get_current_position): New inline method. Use instead of former current_position were appropriate. (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. (fhandler_dev_floppy::lseek): Remove useless conditions. Convert sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case to here. * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. (fhandler_dev_raw::is_eof): Remove. (fhandler_dev_raw::write_file): Remove. (fhandler_dev_raw::read_file): Remove. (fhandler_dev_raw::raw_read): Remove. (fhandler_dev_raw::raw_write): Remove. (fhandler_dev_raw::dup): Drop copying removed members. (fhandler_dev_raw::ioctl): Drop blocksize testing. * wincap.h: Implement has_disk_ex_ioctls throughout. * wincap.cc: Ditto. (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. (wincapc::init): Add Vista/Longhorn handling.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r--winsup/cygwin/include/cygwin/socket.h55
-rw-r--r--winsup/cygwin/include/cygwin/version.h8
2 files changed, 60 insertions, 3 deletions
diff --git a/winsup/cygwin/include/cygwin/socket.h b/winsup/cygwin/include/cygwin/socket.h
index f6dc113..d0344c0 100644
--- a/winsup/cygwin/include/cygwin/socket.h
+++ b/winsup/cygwin/include/cygwin/socket.h
@@ -1,6 +1,6 @@
/* cygwin/socket.h
- Copyright 1999, 2000, 2001 Red Hat, Inc.
+ Copyright 1999, 2000, 2001, 2005 Red Hat, Inc.
This file is part of Cygwin.
@@ -32,8 +32,8 @@ struct ucred {
};
struct linger {
- unsigned short l_onoff; /* Linger active */
- unsigned short l_linger; /* How long to linger for */
+ unsigned short l_onoff; /* Linger active */
+ unsigned short l_linger; /* How long to linger for */
};
struct msghdr
@@ -42,9 +42,58 @@ struct msghdr
int msg_namelen; /* Length of name */
struct iovec * msg_iov; /* Data blocks */
int msg_iovlen; /* Number of blocks */
+ void * msg_control; /* Ancillary data */
+ size_t msg_controllen; /* Ancillary data length */
+ int msg_flags; /* Received flags on recvmsg */
+};
+
+struct cmsghdr
+{
+ size_t cmsg_len; /* Length of cmsghdr + data */
+ int cmsg_level; /* Protocol */
+ int cmsg_type; /* Protocol type */
+};
+
+#define CMSG_ALIGN(len) \
+ (((len) + sizeof (size_t) - 1) & ~(sizeof (size_t) - 1))
+#define CMSG_LEN(len) \
+ (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+#define CMSG_SPACE(len) \
+ (CMSG_ALIGN (sizeof (struct cmsghdr)) + CMSG_ALIGN(len))
+#define CMSG_FIRSTHDR(mhdr) \
+ ({ \
+ struct msghdr *_m = (struct msghdr *) mhdr; \
+ (_m)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (_m)->msg_control \
+ : (struct cmsghdr *) NULL; \
+ })
+#define CMSG_NXTHDR(mhdr,cmsg) \
+ ({ \
+ struct msghdr *_m = (struct msghdr *) mhdr; \
+ struct cmsghdr *_c = (struct cmsghdr *) cmsg; \
+ ((char *) _c + CMSG_SPACE (_c->cmsg_len) \
+ > (char *) _m->msg_control + _m->msg_controllen) \
+ ? (struct cmsghdr *) NULL \
+ : (struct cmsghdr *) ((char *) _c + CMSG_ALIGN (_c->cmsg_len)); \
+ })
+#define CMSG_DATA(cmsg) \
+ ((unsigned char *) ((struct cmsghdr *)(cmsg) + 1))
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+#ifdef __INSIDE_CYGWIN__
+/* Definition of struct msghdr up to release 1.5.18 */
+struct OLD_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 */
};
+#endif
#ifndef socklen_t
#define socklen_t int
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 7984df7..7111ef8 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -88,6 +88,10 @@ details. */
#define CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES \
(CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) >= \
79)
+
+#define CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR \
+ (CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor) <= \
+ 132)
/* We used to use the DLL major/minor to track
non-backward-compatible interface changes to the API. Now we
use an API major/minor number for this purpose. */
@@ -268,6 +272,10 @@ details. */
138: Export readdir_r.
*/
+ /*
+ 133: Start using POSIX definition of struct msghdr.
+ */
+
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0