How to execute 'sz' and 'rc' ?
Leslie Mikesell
les at chinet.chi.il.us
Wed May 1 15:43:56 AEST 1991
In article <1991Apr29.221812.5038 at nicedel.north.de> nyse at nicedel.north.de (Hermann Behrens) writes:
> if((pid = fork()) == 0) {
> close(fp);
> close(0);
> open("/dev/ttyF00", O_RDONLY | O_NDELAY);
> close(1);
> open("/dev/ttyF00", O_WRONLY | O_NDELAY);
>/* I think, that the bug is in the redirecting of stdin and stdout,
>but where is the bug?? */
> execl("/bin/sh", "sh", "-c", "sz a_file",NULL);
On the machines I use, leaving O_NDELAY set will cause very strange
things to happen when you try to write to a device and reads will
complete when no data is present. I'd suggest leaving out the
O_NDELAY on the open if you have reason to expect that carrier
is already up (but you might want to set an alarm to bail you out
just in case). Or, use fcntl() to turn it off after the open before
you let another program try to access the line.
Les Mikesell
les at chinet.chi.il.us
More information about the Comp.unix.sysv386
mailing list