troubleshooting Question

Linux/C

Avatar of sreedhar2u
sreedhar2uFlag for India asked on
Linux OS DevCC++
6 Comments1 Solution1209 ViewsLast Modified:
We have a problem on  the Prefix(Module) port to Linux (x86-64) under Redhat 5.5.

 

Some of the c++ code calls the system function sigsend() in order to send to a single process or group of processes one of the following signals (SIGKILL, SIGTERM or SIGINT). Unfortunately there doesn’t appear to be a sigsend in this version of Linux and I can’t find an equivalent signal function that performs the same tasks. The internet suggest that there are Linux functions (send_sig, send_sig_info), but I can see no mention of them on the machine we have configured with Linux Redhat 5.5 (x86-64). Any help in finding an equivalent and how I would have to change the code to call it would be appreciated?

 

 

 

/**************************************************************************

 *

 *  CLASS FUNCTION HEADER

 *

 *  Member Function : CProcessInstanceData::KillProcess

 *

 *  Synopsis        : Terminate process if running.

 *

 *  Description     : Call OS.

 *

 **************************************************************************

 */

 

void CProcessInstanceData::KillProcess ()

{

    if (m_hPID)

    {

        // signal to kill

        sigsend (P_PID, (id_t) m_hPID, SIGKILL);

 

        // if dead this will clear variables

        IsProcessAlive ();

    }

}

 

 

 

/**************************************************************************

 *

 *  CLASS FUNCTION HEADER

 *

 *  Member Function : CProcessInstanceData::SendStopEvent

 *

 *  Synopsis        : Send event to process or process group.

 *

 *  Description     : Call OS.

 *

 **************************************************************************

 */

 

void CProcessInstanceData::SendStopEvent (BOOL bSendBreak)

{

    if (m_hPID)

    {

        if (m_bProcessGroup)

        {

            if (bSendBreak)

                sigsend (P_PGID, (id_t) m_hPID, SIGTERM);

            else

                sigsend (P_PGID, (id_t) m_hPID, SIGINT);

        }

        else

        {

            if (bSendBreak)

                sigsend (P_PID, (id_t) m_hPID, SIGTERM);

            else

                sigsend (P_PID, (id_t) m_hPID, SIGINT);

        }

    }

}

 
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros