This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

spawnl and signals



If you compile and run program below with latest cygwin you get the
expected behavour

// This is jay.exe

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

volatile int gotsignal=0;

void	sighandler(int signum){gotsignal=signum;return;}

int	main(void)
{int a;

printf("in jay.exe\n");fflush(0);
signal(SIGINT,sighandler);
do{
if(gotsignal!=0)
  {printf("got signal %d\n",gotsignal);
   fflush(0);
   gotsignal=0;break;}
}while(1);
return 0;}

However if you compile and run the program below which calls the above
program then the ctrl-C signal is never detected

// this is jay1.exe

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <process.h>

volatile int gotsignal=0;

void	sighandler(int signum){gotsignal=signum;return;}

int	main(void)
{int a;

spawnl(_P_NOWAIT,"./jay.exe","./jay.exe",0);
//execl("./jay.exe","./jay.exe",0);

return 0;}

this is running under Window 98SE under a DOS prompt
changing the spawnl to a execl makes it work as it should


Jason Moxham
J.L.Moxham@maths.soton.ac.uk


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]