mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Doug McNaught <doug@mcnaught.org>
To: Alex Riesen <fork0@users.sf.net>
Cc: Dirk Bull <dirkbull102@hotmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: shmat problem
Date: 06 Jan 2003 11:50:24 -0500	[thread overview]
Message-ID: <m3smw6gr3j.fsf@varsoon.wireboard.com> (raw)
In-Reply-To: Alex Riesen's message of "Mon, 6 Jan 2003 17:43:32 +0100"

Alex Riesen <fork0@users.sf.net> writes:

> Doug McNaught, Mon, Jan 06, 2003 17:36:39 +0100:
> > > You have to add SHM_REMAP to shmat flags (see definitions of SHM_ flags).
> > Hmm, the manpage (on RH7.3 at least) doesn't mention SHM_REMAP.  Nice
> > to know about it.
> 
> RH7.3 manpage is quiet old, btw.

Apparently so.

> Linux manpages-1.54 (Dec 30 2002):
> 
>    The  (Linux-specific) SHM_REMAP flag may be asserted in shmflg to indi-
>    cate that the mapping of the segment should replace any  existing  map-
>    ping  in  the  range starting at shmaddr and continuing for the size of
>    the segment.  (Normally an EINVAL  error  would  result  if  a  mapping
>    already  exists in this address range.)  In this case, shmaddr must not
>    be NULL.

Wouldn't the OP's code still (potentially) have problems? What if you
had:

char my_shared_area[2048];
int my_unshared_var;

...

   void *foo = shmat(id, &my_shared_area, SHM_REMAP);


Would my_unshared_var end up shared, since memory mappings have page
granularity?

-Doug

  reply	other threads:[~2003-01-06 16:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 16:22 Alex Riesen
2003-01-06 16:36 ` Doug McNaught
2003-01-06 16:43   ` Alex Riesen
2003-01-06 16:50     ` Doug McNaught [this message]
2003-01-06 17:01       ` Alex Riesen
  -- strict thread matches above, loose matches on Subject: below --
2003-01-07  8:14 Dirk Bull
2003-01-07 18:41 ` Alex Riesen
2003-01-06 14:53 Dirk Bull
2003-01-06 15:32 ` Doug McNaught
2003-01-06 15:50   ` Richard B. Johnson
2003-01-06  9:05 Dirk Bull
2003-01-06 14:17 ` Doug McNaught

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=m3smw6gr3j.fsf@varsoon.wireboard.com \
    --to=doug@mcnaught.org \
    --cc=dirkbull102@hotmail.com \
    --cc=fork0@users.sf.net \
    --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

Powered by JetHome