[Problem] raise a signal in FreeBSD

I am trying to send a SIGUSR1 to a set of process. Please tell
me how to do. I've tried the system call raise(int sig) but it just
raise a signal of to the 'current process.'

My program is about a network chat server. When a client
connects in, The main process will fork a new process to handle
the client. Now the problem comes, assume I'm in some client
process now, and I want to send a signal that all the other client
processes can get it.

If I use rasie(), only the current client process will get it.

Is there any way that I can do?

Thanks for help:)

You need to use kill() rather than raise. Don't let the name of the kill() system call mislead you. kill() sends a signal to a process or a group of processes.

You also want to look at setpgid(). Your main process should call this prior to any forks to create a new process group. Then any child can use kill() to signal the entire process group at once.