RE: 2.4 and 2GB swap partition limit

From: David S. Miller (
Date: Mon Apr 30 2001 - 14:07:44 EST

Richard B. Johnson writes:
> On Mon, 30 Apr 2001, Torrey Hoffman wrote:
> > In general, is there a safe way to replace executable files for
> > programs that might be running while their on-disk images are
> > replaced?
> Yes. Perfectly safe:
> mv /usr/bin/exeimage /usr/bin/exeimage.sav
> cp /wherever/exeimage /usr/bin/exeimage
> The executing task will continue to use the old image until it exits.

Even more effective is:

mv /wherever/exeimage /usr/bin/exeimage

The kernel keeps around the contents of the old file while
the executing process still runs.

This is also basically how things like libc get installed.
A single mv is not only preserves currently referenced contents,
it is atomic.

David S. Miller
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:26 EST