Hi! Attached patch mainly contains portability fixes: - use MAP_ANON, that is what both (BSD-)Unix and Linux have - change last_error handling to use pthreads - cleanup: No need to include <xen/sys/privcmd.h> a second time in xg_private.h The patch is mainly based on a diff for NetBSD. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Sep 19, 2007 at 03:19:37PM +0200, Christoph Egger wrote:> Attached patch mainly contains portability fixes: > - use MAP_ANON, that is what both (BSD-)Unix and Linux havelooks like that might bite us back at some point: man mmap: MAP_ANON Synonym for MAP_ANONYMOUS. Deprecated. what about: #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif Cheers, -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wednesday 19 September 2007 16:25:15 Vincent Hanquez wrote:> On Wed, Sep 19, 2007 at 03:19:37PM +0200, Christoph Egger wrote: > > Attached patch mainly contains portability fixes: > > - use MAP_ANON, that is what both (BSD-)Unix and Linux have > > looks like that might bite us back at some point: > > man mmap: > MAP_ANON > Synonym for MAP_ANONYMOUS. Deprecated.MAP_ANONYMOUS is the proprietary thing. The glibc people should know that and should deprecate MAP_ANONYMOUS instead. They should also document that the fd argument must be -1 when MAP_ANON is specified to match the Unix behaviour. Christoph -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Sep 19, 2007 at 04:32:59PM +0200, Christoph Egger wrote:> MAP_ANONYMOUS is the proprietary thing.which "proprietary thing" ?> The glibc people > should know that and should deprecate MAP_ANONYMOUS instead.solaris has deprecated MAP_ANON as well.> They should also document that the fd argument must be > -1 when MAP_ANON is specified to match the Unix behaviour.---------- MAP_ANONYMOUS The mapping is not backed by any file; its contents are initial‐ ized to zero. The fd and offset arguments are ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified, and portable applications should ensure this. The use of MAP_ANONYMOUS in conjunction with MAP_SHARED is only supported on Linux since kernel 2.4. ---------- what are you missing from this ? Cheers, -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wednesday 19 September 2007 16:49:49 Vincent Hanquez wrote:> On Wed, Sep 19, 2007 at 04:32:59PM +0200, Christoph Egger wrote: > > MAP_ANONYMOUS is the proprietary thing. > > which "proprietary thing" ? > > > The glibc people > > should know that and should deprecate MAP_ANONYMOUS instead. > > solaris has deprecated MAP_ANON as well.Oh, SystemV Unix has MAP_ANONYMOUS? BSD-Unix only has MAP_ANON.> > They should also document that the fd argument must be > > -1 when MAP_ANON is specified to match the Unix behaviour. > > ---------- > MAP_ANONYMOUS > > The mapping is not backed by any file; its contents are initial‐ > ized to zero. The fd and offset arguments are ignored; however, > some implementations require fd to be -1 if MAP_ANONYMOUS (or > MAP_ANON) is specified, and portable applications should ensure > this. The use of MAP_ANONYMOUS in conjunction with MAP_SHARED > is only supported on Linux since kernel 2.4. > ---------- > > what are you missing from this ?My linux mmap manpage says: --------------------------- MAP_ANONYMOUS The mapping is not backed by any file; the fd and offset argu- ments are ignored. The use of this flag in conjunction with MAP_SHARED is only supported on Linux since kernel 2.4. MAP_ANON Alias for MAP_ANONYMOUS. Deprecated. --------------------------- My bsd mmap manpage says: ------------------------------- MAP_ANON Map anonymous memory not associated with any specific file. The file descriptor is not used for creating MAP_ANON regions, and must be specified as -1. The mapped memory will be zero filled. ------------------------------- Christoph -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Sep 19, 2007 at 05:04:35PM +0200, Christoph Egger wrote:> > solaris has deprecated MAP_ANON as well. > > Oh, SystemV Unix has MAP_ANONYMOUS? > BSD-Unix only has MAP_ANON.I''ve no idea, but I imagine this was deprecated for a reason on 2 very different systems. and looks like HP-UX only has MAP_ANONYMOUS. some random google searching: http://www.winehq.org/pipermail/wine-devel/2004-December/031636.html classic unix mess i''ld say :(> My linux mmap manpage says: > --------------------------- > MAP_ANONYMOUS > The mapping is not backed by any file; the fd and offset argu- > ments are ignored. The use of this flag in conjunction with > MAP_SHARED is only supported on Linux since kernel 2.4. > > MAP_ANON > Alias for MAP_ANONYMOUS. Deprecated. > ---------------------------Yes, not good indeed. The text i''ve pasted come from my linux debian manpage. you could file a bug to your distro to upgrade the manpages ;) Cheers, -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I checked in the patch anyhow. If it causes problems then we can introduce some ifdef''ery. - Keir On 19/9/07 16:41, "Vincent Hanquez" <vincent@xensource.com> wrote:> On Wed, Sep 19, 2007 at 05:04:35PM +0200, Christoph Egger wrote: >>> solaris has deprecated MAP_ANON as well. >> >> Oh, SystemV Unix has MAP_ANONYMOUS? >> BSD-Unix only has MAP_ANON. > > I''ve no idea, but I imagine this was deprecated for a reason on 2 > very different systems. and looks like HP-UX only has MAP_ANONYMOUS. > > some random google searching: > http://www.winehq.org/pipermail/wine-devel/2004-December/031636.html > > classic unix mess i''ld say :( > >> My linux mmap manpage says: >> --------------------------- >> MAP_ANONYMOUS >> The mapping is not backed by any file; the fd and offset >> argu- >> ments are ignored. The use of this flag in conjunction >> with >> MAP_SHARED is only supported on Linux since kernel 2.4. >> >> MAP_ANON >> Alias for MAP_ANONYMOUS. Deprecated. >> --------------------------- > > Yes, not good indeed. > The text i''ve pasted come from my linux debian manpage. > you could file a bug to your distro to upgrade the manpages ;) > > Cheers,_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Sep 19, 2007 at 04:49:49PM +0200, Vincent Hanquez wrote:> > The glibc people > > should know that and should deprecate MAP_ANONYMOUS instead. > > solaris has deprecated MAP_ANON as well.We don''t even *document* MAP_ANONYMOUS. Where did you get this impression from? regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Sep 19, 2007 at 11:21:54PM +0100, John Levon wrote:> On Wed, Sep 19, 2007 at 04:49:49PM +0200, Vincent Hanquez wrote: > > > > The glibc people > > > should know that and should deprecate MAP_ANONYMOUS instead. > > > > solaris has deprecated MAP_ANON as well. > > We don''t even *document* MAP_ANONYMOUS. Where did you get this > impression from?I actually found that on 2 differents MLs (blender and wine to name them) by some random googling to find the reason it was deprecated on linux (which i still don''t know). Cheers, -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, Sep 20, 2007 at 02:30:15PM +0200, Vincent Hanquez wrote:> > > > The glibc people > > > > should know that and should deprecate MAP_ANONYMOUS instead. > > > > > > solaris has deprecated MAP_ANON as well. > > > > We don''t even *document* MAP_ANONYMOUS. Where did you get this > > impression from? > > I actually found that on 2 differents MLs (blender and wine to name them) > by some random googling to find the reason it was deprecated on linux > (which i still don''t know).Appears to be hearsay... as far as I can tell, GNU libc''s attempt to deprecate it is unilateral. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel