Hi,

The problem I'm having is killing a process without knowing it process ID.

What I have right now is a client-server communication using FIFOs, the server is running in the background and the client is running in the foreground.

What I want to do is when the client quit, I want to be able to kill the server as well.

I tried using kill(0, SIGKILL) but that doesn't seem to work, and when I use kill(-1, SIGKILL) everything dies.

Thanks!

Well the cleanest thing to do would be to send a "quit" message from the client to the server.
The server can then do an orderly shut-down.

Instead of spraying machine-gun fire all over the system with your attempts to kill random processes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.