bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-hurd] Re: msync and MS_*


From: Marcus Brinkmann
Subject: [Bug-hurd] Re: msync and MS_*
Date: Thu, 14 Sep 2000 16:23:51 +0200
User-agent: Mutt/1.1.4i

On Tue, Sep 12, 2000 at 10:26:21AM -0500, Neal H Walfield wrote:
> According to my reading of POSIX.4, if _POSIX_MAPPED_FILES and
> _POSIX_SYNCHRONIZED_IO are defined (as they are on the hurd), then
> msync is available.  On the hurd, both are defined, and a prototype
> for msync is available in sys/mman.h as expected.  However, neither
> this file nor bits/mman.h define the flags that msync takes, ie: MS_SYNC,
> MS_ASYNC and MS_INVALIDATE are defined.  I do not believe that one can
> use msync without these flags.  In conclusion, two questions:
> 
> 1)  Is msync really defined (ie working)?

No, it is a stub, and using it will always return ENOSYS (see
/include/gnu/stubs.h)

> 2)  If so, why are the MS_* flags not defined?
>     If not, why is there are prototype, and why are the appropriate
>     preprocessor variables defined.

Well, usually stubs are defined so that you can compile programs, and as
soon as we implement those stubs, the programs will work without
recompilation. Some programs can work even when the call returns ENOSYS,
probably with limited functionality.

In this special case, we don't define the MS_* symbols, so we can't even
compile the programs using msync. Also, we are a bit optimistic with the
POSIX features.

We probably should not define _POSIX_SYNCHRONIZED_IO, according to unistd.h:

/* Get values of POSIX options:

   If these symbols are defined, the corresponding features are
   always available.  If not, they may be available sometimes.
   The current values can be obtained with `sysconf'.

What a pity, because in the regular case we support it.

I would like to hear Marks and Rolands view on this.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
Marcus.Brinkmann@ruhr-uni-bochum.de,     marcus@gnu.org    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       brinkmd@debian.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]