Re: mmap bug in 2.2.13 (or in documentation)

Abramo Bagnara (abramo@alsa-project.org)
Wed, 29 Dec 1999 20:17:04 +0100


James Manning wrote:
>
> [ Wednesday, December 29, 1999 ] Abramo Bagnara wrote:
> > Cause the fall through in do_mmap (around mm/mmap.c:223) all kind of
> > file mmap are denied with EACCES if file is not open for reading.
> > This is contrary to mmap(2):
> >
> > Another for me incomprehensible option is that mmap(2) is wrong... can
> > someone clarify this?
>
> I started a small lkml thread about this when I saw the same problem
> a couple of months back... since other OS's that I checked had the
> same restriction, and since replacing my creat()'s with open(O_RDWR)
> wasn't a big deal, I just tagged it as a doc bug... I couldn't think
> of a situation where you'd *want/need* to make write-only mmap'd area,
> so this seems fine to me (you could even #define your creat() if you
> don't want to change the code)

Unfortunately to have write-only mmap'd area it's a way to solve our
problem with mmap'd audio devices.
To open the file with the right flag permit to us to discriminate at
open time the application intention:

O_RDONLY -> Capture
O_WRONLY -> Playback
O_RDWR -> Full Duplex

It seems natural, isn't it?
But mmap force us to not use O_WRONLY, grrr...

Now how we can solve this, avoiding to use 3 different minor for each
device (and to use /dev/dsp as it is always used)?

-- 
Abramo Bagnara                       mailto:abramo@alsa-project.org

Opera Unica Via Emilia Interna, 140 Phone: +39.0546.656023 48014 Castel Bolognese (RA) - Italy Fax: +39.0546.656023

ALSA project is http://www.alsa-project.org sponsored by SuSE Linux http://www.suse.com

It sounds good!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/