delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
Date: | Wed, 12 Jan 2011 14:03:05 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Adding madvise function in cygwin with a #define |
Message-ID: | <20110112130305.GB25178@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <AANLkTimioT4OZ7CfW1Kh7R1nWv7uKz6v_3w=Hcgv-J6D AT mail DOT gmail DOT com> <4D2C6AE0 DOT 1000703 AT redhat DOT com> <AANLkTin_qu-uidFWgas31-v4MwWqLbi75svwtO-cUKoZ AT mail DOT gmail DOT com> <20110112111520 DOT GJ6353 AT calimero DOT vinschen DOT de> <AANLkTimLuQRELg_xyahXN4kOGiToTb2Y2LmaHqBMvOGb AT mail DOT gmail DOT com> |
MIME-Version: | 1.0 |
In-Reply-To: | <AANLkTimLuQRELg_xyahXN4kOGiToTb2Y2LmaHqBMvOGb@mail.gmail.com> |
User-Agent: | Mutt/1.5.21 (2010-09-15) |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
On Jan 12 13:03, jdzstz - gmail dot com wrote: > Maybe an implementation option could be: > > 1) Standard advices that only has a influence in application > performance, can be executed as current posix_madvise, checking only > the parameters and doing nothing => MADV_NORMAL, MADV_SEQUENTIAL, > MADV_RANDOM, MADV_REMOVE, MADV_WILLNEED, MADV_DONTNEED > > 2) Rest of advices, that can modify the behaviour of application and > generate errors or security problems, so madvise returns always > "EINVAL" (as you said in your mail) : MADV_REMOVE, MADV_DONTFORK, > MADV_DOFORK, MADV_HWPOISON, MADV_SOFT_OFFLINE, MADV_MERGEABLE, > MADV_UNMERGEABLE > > To reduce problems with applications that uses advises of list number > 2, this constants would be undefined, so if the aplication code make > for example an "madvise(p, sz, MADV_DONTFORK)" at least, the problem > will be detected at compilation time. Well, ok. Since that makes madvise basically identical to posix_madvise, I just exported posix_madvise as madvise as well. The constants are defined in sys/mman.h as you proposed. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |