[Libsysio-commit] b_lustre: libsysio/include cygwin-defs.h sysio.h
Brought to you by:
lward
From: Mei <me...@us...> - 2003-08-18 14:08:04
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv29635/include Modified Files: Tag: b_lustre sysio.h Added Files: Tag: b_lustre cygwin-defs.h Log Message: fixes for build libsysio under Cygwin: - add include/cygwin-defs.h - disable _LARGEFILE64_SOURCE - autoconf test for host_os "cygwin" - exclude getdentries.c, bypass.c, stat64.c for cygwin build - don't include <syscall.h>, <statvfs.h> --- NEW FILE --- /* * Copyright (C) 2003, Cluster File Systems, Inc. * * This code is issued under the GNU General Public License * * add the missing definitions for Cygwin */ #ifndef CYGWIN_DEFS_H #define CYGWIN_DEFS_H #ifndef off64_t #if defined (__alpha__) || defined (__ia64__) typedef long off64_t; #else typedef long long off64_t; #endif #endif /* * VER defs is actually not used under cygwin, simply define to 0 */ #define _MKNOD_VER (0) #define _STAT_VER (0) /* FIXME * glibc in cygwin doesn't support LARGEFILE64. disable it here, but * need further checking 64 bits file I/O support. */ #undef _LARGEFILE64_SOURCE /* * bypass should NEVER happen under cygwin. nullify them. */ struct iovec; static inline ioid_t __bypass_ireadv(int fd, const struct iovec *iov, int count) { return 0; }; static inline ioid_t __bypass_preadv(int fd, const struct iovec *iov, int count, off_t offset) { return 0; }; static inline ioid_t __bypass_iwritev(int fd, const struct iovec *iov, int count) { return 0; }; static inline ioid_t __bypass_pwritev(int fd, const struct iovec *iov, int count, off_t offset) { return 0; }; static inline int __bypass_fcntl(int fd, int cmd, va_list ap) { return -1; }; #endif /* CYGWIN_DEFS_H */ Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -u -w -b -B -p -r1.7.4.2 -r1.7.4.3 --- sysio.h 15 Aug 2003 07:43:15 -0000 1.7.4.2 +++ sysio.h 18 Aug 2003 13:56:04 -0000 1.7.4.3 @@ -79,6 +79,11 @@ typedef void *ioid_t; #define MAX_SYMLINK 250 #endif +/* cygwin specific definitions */ +#ifdef __CYGWIN__ +#include "cygwin-defs.h" +#endif + /* * Internally, all directory entries are carried in the 64-bit capable * structure. @@ -150,7 +155,11 @@ extern int rmdir(const char *path); extern int symlink(const char *path1, const char *path2); extern int unlink(const char *path); extern int fdatasync(int fd); +#ifndef __CYGWIN__ extern int ioctl(int fd, unsigned long request, ...); +#else +extern int ioctl(int fd, int request, ...); +#endif extern mode_t umask(mode_t mask); extern int iodone(ioid_t ioid); extern ssize_t iowait(ioid_t ioid); |