From 3426f9645451115902e8de0420172ca70d2dba78 Mon Sep 17 00:00:00 2001 From: corinna Date: Wed, 12 Jan 2011 22:01:42 +0000 Subject: [PATCH] * cygwin.din (madvise): Export posix_madvise as madvise. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR. * include/sys/mman.h: Define madvise constants, keep Linux-specific constants undefined. (madvise): Declare. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/include/cygwin/version.h | 7 ++++--- winsup/cygwin/include/sys/mman.h | 23 ++++++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5d6e4beb11..bded09aa03 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,13 @@ 2011-01-12 Corinna Vinschen + * cygwin.din (madvise): Export posix_madvise as madvise. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR. + * include/sys/mman.h: Define madvise constants, keep Linux-specific + constants undefined. + (madvise): Declare. + +2011-01-12 Corinna Vinschen + * fhandler.h (struct part_t): New type. (class fhandler_dev_floppy): Convert partitions to part_t pointer. Add lock_partition method. diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index e92353a8c1..c75782752a 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -1,7 +1,7 @@ /* version.h -- Cygwin version numbers and accompanying documentation. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -397,13 +397,14 @@ details. */ cpowf, cproj, cprojf, creal, crealf, csin, csinf, csinh, csinhf, csqrt, csqrtf, ctan, ctanf, ctanh, ctanhf. 233: Add TIOCGPGRP, TIOCSPGRP. Export llround, llroundf. - 234: Export program_invocation_name, program_invocation_short_name + 234: Export program_invocation_name, program_invocation_short_name. + 235: Export madvise. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 234 +#define CYGWIN_VERSION_API_MINOR 235 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/mman.h b/winsup/cygwin/include/sys/mman.h index 234de8074d..6942c2ad80 100644 --- a/winsup/cygwin/include/sys/mman.h +++ b/winsup/cygwin/include/sys/mman.h @@ -1,6 +1,6 @@ /* sys/mman.h - Copyright 1996, 1997, 1998, 2000, 2001, 2003, 2005, 2007 Red Hat, Inc. + Copyright 1996, 1997, 1998, 2000, 2001, 2003, 2005, 2007, 2011 Red Hat, Inc. This file is part of Cygwin. @@ -56,6 +56,26 @@ extern "C" { #define POSIX_MADV_WILLNEED 3 #define POSIX_MADV_DONTNEED 4 +/* + * Flags for madvise. BSD/Linux-specific. + */ +#define MADV_NORMAL 0 +#define MADV_SEQUENTIAL 1 +#define MADV_RANDOM 2 +#define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 +/* Deliberately don't define these Linux-specific flags. An application + expecting them to behave as defined would be in for a surprise. */ +#if 0 +#define MADV_REMOVE 5 +#define MADV_DONTFORK 6 +#define MADV_DOFORK 7 +#define MADV_HWPOISON 8 +#define MADV_SOFT_OFFLINE 9 +#define MADV_MERGEABLE 10 +#define MADV_UNMERGEABLE 11 +#endif + #ifndef __INSIDE_CYGWIN__ extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, off_t __off); #endif @@ -66,6 +86,7 @@ extern int mlock (const void *__addr, size_t __len); extern int munlock (const void *__addr, size_t __len); extern int posix_madvise (void *__addr, size_t __len, int __advice); +extern int madvise (void *__addr, size_t __len, int __advice); extern int shm_open (const char *__name, int __oflag, mode_t __mode); extern int shm_unlink (const char *__name); -- 2.11.0