From: "Matías Aguirre" <matiasaguirre@gmail.com>
To: linux prg <linux-c-programming@vger.kernel.org>,
Luiz Fernando Capitulino <lcapitulino@conectiva.com.br>
Subject: Re: process information
Date: Thu, 7 Jul 2005 13:26:09 -0300 [thread overview]
Message-ID: <a3c4234105070709267129a646@mail.gmail.com> (raw)
In-Reply-To: <42CD1B92.1070806@conectiva.com.br>
On 7/7/05, Luiz Fernando Capitulino <lcapitulino@conectiva.com.br> wrote:
> Hi Matías,
Hi Luiz
> Yes, there is. But I can only think in a 'brute force' way: you can scan the
> /proc file-system.
[...]
Yes, I was thinking in that solution, but it doesn't fix in my
situation, my problem is a bit complicated...
I lunch a little process that inicialize a shmem segment (libmm), then
it call a function that's in a library, this function makes a fork and
create a server as the son process (an abyss http server, i'm using
libxmlrpc-c3) and then do an exit(0) in the father, and this unmap the
shmem allocated, this because allocation and deallocation is made by
the next functions:
void __attributte__ ((constructor)) void _init_fn(){
root_p=getpid();
MM_create(MM_SIZE,MM_FILE);
signal(SIGINT|SIGTERM|SIGSEGV|SIGABRT|SIGHUP,_sigint);
}
void __attribute__ ((destructor)) _uninit_fn(){
if(getpid()==root_p)
MM_destroy();
}
where root_p is the pid of the process that inicialize every thing, so
when it dies the shmem is deallocated, as you can see, it dies because
the function that lunch the server mekes an exit(0).
So, i'm traying to make a little trick, a first process that create
the shmem and makes a fork, this new son lunch the server, but now I
need to know when the server dies so my process can finish and
deallocate the shmem.
Sorry, but my english is very bad... :)
Thanks
--
Matías Aguirre
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2005-07-07 16:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-06 20:15 process information Matías Aguirre
2005-07-07 4:46 ` sumit kalra
2005-07-07 12:09 ` Luiz Fernando Capitulino
2005-07-07 16:26 ` Matías Aguirre [this message]
2005-07-08 19:48 ` Luiz Fernando Capitulino
2005-07-07 18:48 ` x86 Endiannes and libc printf Nanakos Chrysostomos
2005-07-09 17:43 ` Glynn Clements
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=a3c4234105070709267129a646@mail.gmail.com \
--to=matiasaguirre@gmail.com \
--cc=lcapitulino@conectiva.com.br \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).