All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: Jagadeesh Bhaskar P <jbhaskar@hclinsys.com>
Cc: Linux C Programming <linux-c-programming@vger.kernel.org>
Subject: Re: The stickybit!!
Date: Sat, 18 Dec 2004 00:25:34 +0000	[thread overview]
Message-ID: <16835.30974.291491.153681@cerise.gclements.plus.com> (raw)
In-Reply-To: <1103265276.6880.8.camel@myLinux>


Jagadeesh Bhaskar P wrote:

> 	Though it is known that stickybit is obsolete, im just curious to see
> the effect of setting a sticky bit on an executable file.
> 
> 	Is there a way to findout the data if residing in swap area after the
> process is terminated, using a C program??

Read-only sections (e.g. text, rodata) of binaries (executables or
libraries) will never end up in the swap file. Either they reside in
RAM or they don't; if they don't, they will be read in from the binary
as required.

The swap file is only used for storing mutable data (e.g. data or bss
sections of binaries, memory allocated by brk() or anonymous mmap(),
or writeable mmap()ed files using MAP_PRIVATE).

Immutable data is already stored in the mapped file, so there's no
point in copying it to swap.

As for the question which you presumably meant to ask, i.e. how to
determine if a particular page of a file is currently stored in
physical RAM, I don't have an answer.

Obviously, the kernel has this information, so you could always dig it
out of /dev/kmem or /proc/kcore or similar. I don't know whether
there's a better interface.

-- 
Glynn Clements <glynn@gclements.plus.com>

      parent reply	other threads:[~2004-12-18  0:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-17  6:34 The stickybit!! Jagadeesh Bhaskar P
2004-12-17  9:34 ` Jan-Benedict Glaw
2004-12-17 10:38   ` Jagadeesh Bhaskar P
2004-12-17 15:20     ` Jan-Benedict Glaw
2004-12-18  0:25 ` Glynn Clements [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=16835.30974.291491.153681@cerise.gclements.plus.com \
    --to=glynn@gclements.plus.com \
    --cc=jbhaskar@hclinsys.com \
    --cc=linux-c-programming@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.