#include
<
stdio.h
>
#include < sys / types.h >
#include < signal.h >
#define BLOCK_PROCESS_PID 96
int main()
{
if (kill(BLOCK_PROCESS_PID,SIGSTOP) < 0 ) {
fprintf(stderr, " error occurs when trying to block the specified process. " );
exit( 0 );
}
printf( " sleep for 10 seconds to view the result. " );
sleep( 10 );
printf( " wake up to view the result. " );
if (kill(BLOCK_PROCESS_PID,SIGCONT) < 0 ) {
fprintf(stderr, " error occurs when trying to awake the process. " );
exit( 0 );
}
return 1 ;
}
#include < sys / types.h >
#include < signal.h >
#define BLOCK_PROCESS_PID 96
int main()
{
if (kill(BLOCK_PROCESS_PID,SIGSTOP) < 0 ) {
fprintf(stderr, " error occurs when trying to block the specified process. " );
exit( 0 );
}
printf( " sleep for 10 seconds to view the result. " );
sleep( 10 );
printf( " wake up to view the result. " );
if (kill(BLOCK_PROCESS_PID,SIGCONT) < 0 ) {
fprintf(stderr, " error occurs when trying to awake the process. " );
exit( 0 );
}
return 1 ;
}