Re: Preferred portable way to talk to a server process

"Wan-Teh Chang" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
On Mon, Jul 21, 2008 at 5:38 AM, Joachim Ziegler <[email protected]> wrote:
> Hello,
>
> what's the preferred, portable way in NSPR to talk to a server process
> for saying such things as "do a clean shutdown", "reload your config
> file", "re-index your database" and so on?
>
> I've read that (Unix-)signals are highly non-portable. Which
> interprocess communication concept should I
> use to get the same code running under Unix and Windows?

This is an area that NSPR doesn't address.  You'll need to
use platform-specific ways to do that.  It is true that Unix
signals are not supported on Windows.

> BTW, is there an equivalent for getpid() in NSPR?

No.  This is because no NSPR functions operate on
process IDs.

You can just use getpid().  On Windows you may need
to add a _ prefix: _getpid().

> BTW2: I miss a full-text search through the documentation for looking up
> keywords such as "getpid", "signal" etc.

You can try a full-text search through the NSPR source
tree at http://mxr.mozilla.org/nspr/.  For example,
http://mxr.mozilla.org/nspr/search?string=getpid

Wan-Teh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.