Re: Can't undate running process binary in Solaris?
- From: Frank Cusack <fcusack@xxxxxxxxxxx>
- Date: Thu, 05 Jul 2007 13:41:14 -0700
On Thu, 05 Jul 2007 13:34:23 -0700 Frank Cusack <fcusack@xxxxxxxxxxx> wrote:
On Thu, 05 Jul 2007 03:40:12 -0700 Boltar <boltar2003@xxxxxxxxxxx> wrote:
I'm trying to get a running process to update its own binary but for...
some reason under Solaris it doesn't work , the binary remains
unchanged even though no errors are returned from any function. Does
anyone know why this might happen? My test code is below:
mptr = (char *)mmap(^^^^^^^^^^^
NULL,fs.st_size,PROT_READ | PROT_WRITE,MAP_PRIVATE,fd,
Actually, even when you fix that i don't think you'll be able to
update in-place. You will probably get ETXTBUSY or whatever the
error is, if not at mmap() time, than maybe you'll get SEGV or
a bus error when you actually write to memory.
If a program's text is busy (I mean, if a program is running),
Solaris will not let you, e.g., do something like "echo > program".
Or do I have it backwards and it's Linux that doesn't allow this?
-frank
.
- Follow-Ups:
- Re: Can't undate running process binary in Solaris?
- From: David Schwartz
- Re: Can't undate running process binary in Solaris?
- From: Eric Sosman
- Re: Can't undate running process binary in Solaris?
- From: Rainer Weikusat
- Re: Can't undate running process binary in Solaris?
- References:
- Can't undate running process binary in Solaris?
- From: Boltar
- Re: Can't undate running process binary in Solaris?
- From: Frank Cusack
- Can't undate running process binary in Solaris?
- Prev by Date: Re: Can't undate running process binary in Solaris?
- Next by Date: Re: Can't undate running process binary in Solaris?
- Previous by thread: Re: Can't undate running process binary in Solaris?
- Next by thread: Re: Can't undate running process binary in Solaris?
- Index(es):
Relevant Pages
|