I just took a quick look at my older posix book (1993 spec) and
it looks like if <uinstd.h> does not define _POSIX_MAPPED_FILES
(section 2.9.3) that the system does not have to support the
memory mapped files option. I did a quick test and this constant
is not defined, so I believe that not supporting memory mapped
files fully does not make Neutrino non-posix.
-Peter
Maurizio Rossi <mrossi@system-group.it> wrote:
Please, Mr. Steinhoff and Mr.Berdahl,
can you post the POSIX specs regarding that this stuff MUST (or MUST NOT) be
supported for POSIX
compliancy?Armin Steinhoff <A-Steinhoff@web_.de> wrote in message
news:3A24C965.4DE19A80@web_.de…
Eric Berdahl wrote:In article <901lri$4dn$> 1@inn.qnx.com> >, “Igor Kovalenko”
Igor.Kovalenko@motorola.com> > wrote:Armin Steinhoff <A-Steinhoff@web_.de> wrote in message
news:3A23DFD9.FCD56DF3@web_.de…Hi,
the following sequence of library calls can’t be
used with QNX6fd = open("/dev/mypcicard", O_RDWR);
base = mmap(NULL, myFrameBufferSize,
PROT_NOCACHE | PROT_READ | PROT_WRITE,
0, fd, 0 /* start of frame buffer */);The usage of the calls above is fully POSIX and
UNIX98 compliant … but it doesn’t work with
QNX6.After suffering several years with the same
problem under QNX4 … is there a chance to get
for QNX6 a clean and compliant implementation of
the mmap call ??
Will QNX6 not be fully POSIX compliant ??
You’re effectively asking why can’t QNX6 have VM model used by modern
Unixes. It can, but it takes lot of development. Unixes have long
history
behind them and their VM evolved along the lines. QNX can’t just take
their
code. Or may be they can, but they don’t want it. It is a half million
lines
of code.Now, if you just add MAP_NOSYNCFILE to flags in the above snippet, it
will
work, just without syncronization between memory and file. I think
this
has
been discussed a dozen times already. But yes, I want them to get it
fully
working too, eventually >There’s another falacy with the above code. Notice that the thing you’re
mmap’ing is a device (a file descriptor opened from the /dev file
system).That’s completely standard with UNIX systems …
that’s the reason why
‘cat /dev/fd0’ works.Thus, you also need a driver written to support the mmap system
call.No … you need just system services and not a
driver.As such, I consider the above set of code to be outside the POSIX
standard, even though the actual calls involved (open and mmap) are
POSIX routines.Your consideration is simply wrong.
POSIX does not define a driver model,
Huh … who is talking about driver models?
nor does it define that the above code MUST work.
It MUST work if the system claims to be fully
POSIX compliant.It just happens to work for many UNIXes.
No … it just happens for POSIX compliant systems,
because POSIX isn’t bound to UNIX.In QNX, you can
achieve the same effect through a similar mechanism (shm_open and mmap,
with the explicit approval of the driver involved).You can always do your own thing … but we are
talking about POSIX compliancy.Armin
Regards,
Eric