Some questions
Clive Thomson
ct at tcom.stc.co.uk
Thu Jun 28 21:00:26 AEST 1990
Hello,
I have recently started the long journey that will hopefully lead to UN*X
enlightenment, and have some questions I hope somebody will answer for me.
1) The document for the dup call says that it will return the lowest numbered
file descriptor not used by the process. With the exception of one line
in "The design and implementation of the BSD 4.3 UNIX operating system"
(Leffler et al) I have seen no documentation to say open, creat and socket
will do the same. Observation of open seems to suggest that the lowest fd
is used, but I would like to be sure.
2) When I am doing socket programming (ULTRIX 3.0 and SunOS4), and I do a
bind, if the program terminates abnormally, I find that when I re-run the
program the bind will fail with an "in use" error. Is there any way to
convince the system that it is no longer "in use" (assuming of course
uid, gid etc are the same).
3) I am a little confused by the "death of child signal". Is the following
correct. If the parent ignores this signal, the kernel will release
entries for zombie processes automatically. If the parent uses the default
handler, it must wait() for the death of each child, or the child will
become a zombie. If the parent invokes its own handler, in this handler
a wait should be invoked, otherwise the child will become a zombie. If
the parent dies before the children, all children are adopted by the init
process, and the programmer need no longer worry about zombie processes.
Thanks for your time.
--
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Clive Thomson ...!mcvax!ukc!stc!ct +
+ ct at tcom.stc.co.uk +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the Comp.unix.questions
mailing list