gcj: SignalListener, process pid, ...

Tom Tromey tromey@redhat.com
Sun Sep 28 20:19:00 GMT 2003


>>>>> "Erik" == Erik Poupaert <erik.poupaert@freestyler-toolkit.org> writes:

Erik> For long-running processes (serverside programs) on linux, I
Erik> need to "signal" them with -HUP to reread their config files,
Erik> and "-TERM" to stop operating. How can I respond to signals in
Erik> gcj? I mean, is there a class like "SignalListener" anywhere?
Erik> Do I need to wrap something with CNI? Has anybody done that
Erik> already?

I don't know of any existing code to do it.  You'd have to write it
yourself.

Erik> The proper place where gcj would make pids available would be
Erik> java.lang.System, but it's not there? Another wrapper?

Yes, another wrapper.

Erik> Has anybody already created a CNI-based posix-oriented library
Erik> that makes the classical unix concepts available in gcj
Erik> (environment vars, signals, pid, essential areas in libc,...). I
Erik> wonder how you can write decent server programs for unix/linux,
Erik> without it?

People have talked about POSIX wrappers for java (and libgcj), but I
don't recall seeing an implementation.  There's a thread about this in
our archives (which you participated in :-), e.g.:

    http://gcc.gnu.org/ml/java/2003-04/msg00441.html

Tom



More information about the Java mailing list