Hi-
I’m having trouble using spawn to start a shell script. For some reason, the following error message is printed:
invalid file descriptor to bufgets: 20
The spawn function call does not return an error, so my C program thinks everything is fine. The script’s process turns into a zombie. Spawning an equivalent C program in place of the script works fine.
Here’s some sample code from the caller:
qnx_spawn_options.priority= 10;
if ( (pid= spawnl( P_NOWAIT, “/home/peted/bin/sleep.sh”,
“/home/peted/bin/sleep.sh”, “0”, NULL )) == ERROR )
{
printf( “start_tasks: couldn’t spawn /home/peted/bin/sleep.sh 0, error= %s.”,
strerror(errno) );
}
The script is very simple. It’s set to be world executable; the “shebang” line is in the upper left corner of the file:
#!/bin/sh
while [ 1 ]
do
sleep 60
done
The same problem happens with a call to spawnv().
Any thoughts?
TIA,
- Pete