Skip to main content

Sending Data Other Process Signals

Sending Signals With payload.
1) we can send signal from one process to other along with data.
2) Data can be an int or pointer to some location.
3) For pointer both process should have access to that location, In case of integer,
data is part of the signal.
4) There is no provision to include the payload in signal which is sent from kernel.
Example:
file: first.c
#include
#include
void sighandler(int sig, siginfo_t *info, void *arg)
{
printf("In Handler value %d\n", info->si_value.sival_int);
}
main()
{
struct sigaction sa;
int ret;
sa.sa_sigaction = sighandler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART | SA_SIGINFO;
if((sigaction(SIGUSR1, &sa, NULL)) == -1) {
printf("Can't register handler\n");
}
for(;;) {
pause();
}
}
file second.c
#include
#include
#include
main(int argc, char *argv[])
{
sigval_t value;
int ret, pid;
if(argc < 2) {
printf("%s \n", argv[0]);
return;
}
pid = atoi(argv[1]);
value.sival_int = atoi(argv[2]);
ret = sigqueue(pid, SIGUSR1, value);
if(ret) {
perror("sigqueue\n");
}
}

Comments

Popular posts from this blog

dasara marathi message dasara greetings in marathi

Dasara Marathi Greetings-SMS-marathi-Messages-vijaya dasami
marathi greeting cards for vijaya dasami
Happy Vijaya Dashami ! Celebrate the victory of the forces of good over Evil
Dasara is celebrated in Nepal by the name of Dashain. Vijayadashami (Hindi and Marathi: विजयादशमी, Kannada:ವಿಜಯದಶಮಿ)

Marathi Wishes for Dasara..
Apanas ani aplya kutumbiyans Vijayadashami nimmitt hardik shubhechha!

dassera greetings, marathi world, greetings, dassera, marathi greeting MARATHIGREETING.COMSpecial Marathi Greetings from marathiGreeting.com. ...Dasera, nljk. New Born, ckGkph pkgwy. Marathi Birthday, okMarathi Diwali ...
www.marathigreeting.com/

मराठी शुभेच्छापत्रे greeting marathi greetings...New Marathi Greeting Cards. Send this Marathi Dipawali Greeting Dasara Greeting Card to your friends · Click to Send this Greeting card to your friends for ...
www.marathimati.com/greetings/Send_Dasara_Card1.asp

मराठी शुभेच्छापत्रे - Greetings Cards, Marathi ...
Send free Marathi Greetings, electronic Greetings, m…

Rajasthan Board 10th Results | rajedubord.nic.in | RBSE

Raj Board of Secondary Education, Rajasthan Results at rajeduboard.nic.inBoard of Secondary Education, Rajasthan Ajmer declared result of secondary examination today at 4PM official site is rajedubord.nic.in

check Secondary Examination- 2008 Result
(To be announced on July 1st, 2008 at 4:00 PM)
source
http://rajresults.nic.in/

Declared result
Praveshika Examination-2008 Result
(Announced on June 25, 2008 at 4:00 PM)

The history of the Board of Secondary Education Rajasthan (BSER) is a remarkable panorama of progressive record of the futurological vision for developing a dynamic system of various sub-systems of examinations and highlights of the academic excellence of the last four decades. The BSER took rapid strides for promotion and development of Secondary Education in Rajasthan, spread over 3,42,239 sq. km. and in more than 6000 schools located in 32 districts involving 8.5 lakhs students for Secondary and Senior Secondary Examination in the year 2000.

At present the Board is conducting …

CROSS COMPILING X11 FOR ARM Board

STEPS FOR CROSS COMPILING X11 FOR ARM
Go to /usr/X11R6/lib in my linux PC.1) install ARM toolchain, If not installed
2) Get x11 source from http://www.x.org/
3) extract all the tar files, using tar -xvzf
4) edit cross.def and host.def files, in cross.def set the paths
of tool chain in host.def file set crossCompile to YES and
DoLoadableServer to NO
5) make shadow directory "build" and link to xc "lndir ../xc"
6) run Make World
error: linux_vm86.c 281 impossible constraint in 'asm'
268 res might be used uninitialized in this function.
fix:comment line 281,
set res=0
error: implicit decleration of function 'SET_FLAG'
fix: comment line 111 in
programs/Xserver/hw/xfree86/os-support/linux/int10/helper_exec.c
error:Undefined reference to XF86VidModeQueryVersion in glxinfo
And glxgears
Undefined reference to XF86VidModeQueryVersion in xdriinfo
fix:download libXxf86vm.so.1.0 into our armtoolchain lib path
and make softlinksln -s libXxf86vm.so.1.0 libXxf86vm.so
ln -s libX…