public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Rohland <cr@sap.com>
To: Dave Gilbert <gilbertd@treblig.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: shmat returning NULL with 0 sized segment
Date: 26 Dec 2000 10:31:37 +0100	[thread overview]
Message-ID: <m3vgs8b9u5.fsf@linux.local> (raw)
In-Reply-To: <Pine.LNX.4.10.10012250109450.666-100000@tardis.home.dave>
In-Reply-To: <Pine.LNX.4.10.10012250109450.666-100000@tardis.home.dave>

Dave Gilbert <gilbertd@treblig.org> writes:

>   I'm trying to debug a weird problem with Xine - its screwing up its use
> of shared memory for regions I haven't sussed yet.  One odd consequence is
> that it has apparently successfully managed to allocate a 0 byte chunk of
> shared memory; shmat is then called with shmaddr=0 and shmflg=0; the
> result of shmat is 0
> 
>   Is this what shmat is supposed to do in this (admittedly odd)
> circumstance? The error behaviour is defined in the man page as returning
> -1 on error.

Yes, this should be competely legal and wanted. Some programs use
shmget (..,0,..) to test if the segment is there. Apparently Xine does
this while setting the IPC_CREATE flag. This is legal on 2.4 (wasn't
in 2.2) and gives you a 0 byte segment.

shmat will give you then the legal address 0 like mmap would.

Greetings
                Christoph

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

      reply	other threads:[~2000-12-26  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-25  1:13 shmat returning NULL with 0 sized segment Dave Gilbert
2000-12-26  9:31 ` Christoph Rohland [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3vgs8b9u5.fsf@linux.local \
    --to=cr@sap.com \
    --cc=gilbertd@treblig.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox