Best way to check when pty slave has closed?



HI

I've got a program that spawns of a child and the parent and child
communicate via a pty master-slave pair. Problem is , when the child
closes the slave pty file descriptor no notification comes through the
the parent - it carries on sitting in select() on the master fd.

Is there a way to check for when the slave has been closed (on linux)?

Thanks for any help

B2003
.