Zmodem through ttygserial

Christopher Taylor chtaylo3 at gmail.com
Fri Aug 8 05:37:03 UTC 2008


I'm not sure if this is the right place to ask the question.

I have this C application that communicates over ttygserial using a
very rudimentary text based interface.   Trying to get Zmodem
transfers stable over ttygserial and I'm having a devil of a time with
it.

Closing the fd for ttygserial, doing a system call for Zmodem (lsz
_filename_ > /dev/ttygersial < /dev/ttygserial) then reopening
/dev/ttygserial seems to work ok.  I'd prefer to be able to so this
with any generic fd...

When I try and do a fork and dup2(fd,0); dup2(fd,1) in the child and
then execl to the lsz binary then it pretty much hangs after a while.
Tried fooling around with some of the parameters for lsz and nothing
seems to work (notably -L -l and -w).   I do the usual house keeping
before the execl (set sighandlers to default, etc).

I verified my termios settings for the ttygserial fd via strace on a
lsz from the embedded platform and compared those settings to the
settings I have to make sure they're a match and everything is in
order :/

This initially doesn't make sense to me, but I have to wonder why the
difference b/n the two approaches so that takes me to the fact that
I'm going through an opened (pseudo) terminal as opposed to writing
directly to the file.  Not sure what difference that makes except for
the relatively small buffer in pseudo-terminals ... if ttygserial is
implemented as a pseudo terminal, could this be causing the problem?

Anyone run across this?

-Chris



More information about the uClibc mailing list