Mail Archives: cygwin/2011/01/11/09:36:32
--------------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 -