Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* grantpt() fails after repeated operations
@ 1998-06-04  4:00 Dean J.
  1998-06-05  4:00 ` Serguei Patchkovskii
  1998-06-05  4:00 ` David S. Goldberg
  0 siblings, 2 replies; 3+ messages in thread
From: Dean J. @ 1998-06-04  4:00 UTC (permalink / raw)



PROBLEM/ BACKGROUND:

I'm trying to establish a pseudo-tty slave driver which runs ftp as a
child process, allowing me to write ftp commands and read replies (I
know expect does this, but ...)

The code does pretty much everything that's outlined in the book
"Advanced Programming in the Unix Environment".

Specifically, it does the following key processing:

1) opens master -/dev/ptmx
2) grantpt
3) unlockpt
4) opens slave, after getting ptsname
5) pushes modules ptem and ldterm

... it goes on to exec the ftp program and I proceed to write ftp
commands and read RFC959 (ftp standard) replies from  the associated
stream.


One of my specific requirements is to establish a PTY/ftp child
regularly, once every hour, send my files (put etc.) and tear down the
PTY and go dormant. Its supposed to do this theoretically for ever, i.e.
on the hour every hour  establish a PTY and send the files, then
de-establish the PTY et sequentia.

My problem is that I can only perform about 500 (it varies) such
iterations until grantpt specifically starts to fail. The errno is
pretty whacked, i.e. looks like its not getting set. BTW environment is
Digital 4.0D. Importantly, for testing purposes, I am cutting down the
test time iterations from one hour send intervals to 60 second send
intervals, so I can achieve 'endurance testing/longevity testing.' in
much less time.

QUESTIONS: Finally, here are my questions:

** What could be causing grantpt() to fail after its successful for
hundreds of times (i.e. return -1)?
** Could it be that basically doing the above every 60 seconds causes
some drain on the system to the point of failure? If I waited every hour
(as intended in the final implementation, would the associated resources
look after themselves or be looked after by some other process/system
daemon?
** Is there some cleanup processing I can do/should be doing to free up
the associated /dev/ptmx - /dev/pts/N resources et al?
** Could the problem lie elsewhere?
** Does anybody have any similar experiences?

Any contributions, greatly appreciated, in fact, if you live in the
Boston area, I'll give you a six pack of fine beer in appreciation (my
home brew ;-) )

Dean



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-06-05  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-06-04  4:00 grantpt() fails after repeated operations Dean J.
1998-06-05  4:00 ` Serguei Patchkovskii
1998-06-05  4:00 ` David S. Goldberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox