delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/01/11/09:36:32

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_DZ,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4D2C6AE0.1000703@redhat.com>
Date: Tue, 11 Jan 2011 07:36:16 -0700
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Adding madvise function in cygwin with a #define
References: <AANLkTimioT4OZ7CfW1Kh7R1nWv7uKz6v_3w=Hcgv-J6D AT mail DOT gmail DOT com>
In-Reply-To: <AANLkTimioT4OZ7CfW1Kh7R1nWv7uKz6v_3w=Hcgv-J6D@mail.gmail.com>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig8B5CA1482B790C673EAF63BE
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 01/11/2011 04:13 AM, jdzstz - gmail dot com wrote:
> Testing a linux application that uses "madvise", varnish cache, I have
> realized that in cygwin doesnot exists this function but exists the
> alternative "posix_madvise".
>=20
> Adding inside configure.ac script:
> +		AC_DEFINE([madvise], [posix_madvise], [In CYGWIN, madvise function
> is not defined, instead we use posix_madvise])
> +		AC_DEFINE([MADV_RANDOM], [POSIX_MADV_RANDOM], [In CYGWIN,
> MADV_RANDOM define is not defined, instead we use POSIX_MADV_RANDOM])

madvise is more powerful than posix_madvise; while this workaround may
have let you get varnish working, it is not a panacea for all clients of
madvise.  You are better off filing a bug report against varnish that
they should either use the POSIX interface, or add a configure-time
check for the presence of madvise.

> I think it could be interesting adding this defines to cygwin headers,
> at the end of <sys/mman.h> file
>=20
> #define madvise posix_madvise
> #define MADV_NORMAL POSIX_MADV_NORMAL
> #define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL
> #define MADV_RANDOM POSIX_MADV_RANDOM
> #define MADV_WILLNEED POSIX_MADV_WILLNEED
> #define MADV_DONTNEED POSIX_MADV_DONTNEED

While these defines may make sense _once madvise is implemented_ in
cygwin, I don't want them any sooner.  In other words, we need a cygwin
port of madvise before we pollute the namespace with MADV_* constants.
That said, since Linux supports madvise and cygwin tries to emulate
Linux, a patch to implement madvise() is more than welcome.

--=20
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig8B5CA1482B790C673EAF63BE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJNLGrgAAoJEKeha0olJ0NqxrIIAJp+OChB34BOY3sIyha1z35c
nVNPOjtXlhPL09/dHp86Dz7H3zhHmQoL/x4IA2n+vBGDPTRIctnkDolP/3Ip8aZA
njHL3ikOk7LHL7WKGSDQckbBG/X90xBEzHV7kjLqB44WmBORHkqlnEA1pWKJJIAG
rTeWGLPzl2LtP1o3k/6rbkSrPYBq6PeboDH65ECdR0MvvmGwBnTZz1g7s5voXwgk
rFqoOdx9FbruVMaY3OmqD9Fc9NIgKrSqKMFyZ6nC210MpPD1w4anIctFik3w0yYh
Int/tiDpRmz8Sr2BLkEuGprTRNzqw/V6A8GcMb6ObW4e/N9/U5E27gnLy3LGGQc=
=zCxT
-----END PGP SIGNATURE-----

--------------enig8B5CA1482B790C673EAF63BE--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019