Skip site navigation (1) Skip section navigation (2)

Re: BUG #2406: Not all systems support SHM_SHARE_MMU

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul van der Zwan <Paul(dot)Vanderzwan(at)Sun(dot)COM>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2406: Not all systems support SHM_SHARE_MMU
Date: 2006-04-25 14:46:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Paul van der Zwan <Paul(dot)Vanderzwan(at)Sun(dot)COM> writes:
> AFAIK getpagesizes() appeared in 2001 so that probably means it is  
> missing in anything before Solaris 9.

We could handle this without relying on getpagesizes() by just trying
and falling back:

	memAddress = shmat(shmid, addr, SHM_SHARE_MMU);
	if (memAddress == (void *) -1 && errno == EINVAL)
		memAddress = shmat(shmid, addr, 0);
	memAddress = shmat(shmid, addr, 0);

However, I would argue that a system is pretty broken if it exposes the
SHM_SHARE_MMU #define and then rejects it at runtime.

> I'll see if I can get the x86 experts here to have a look at it...

I think either Solaris/x86 should not expose this #define, or it should
silently ignore the bit at runtime.  AFAICS, SHM_SHARE_MMU has no
guaranteed semantic effect anyway, it's just a performance hint; so
ignoring it on platforms that can't handle it is reasonable.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Paul van der ZwanDate: 2006-04-25 18:23:47
Subject: Re: BUG #2406: Not all systems support SHM_SHARE_MMU
Previous:From: Peter BrantDate: 2006-04-25 14:46:39
Subject: Re: BUG #2371: database crashes with semctl failed

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group