This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e table in incremented from 1 to 2. When the parent closes its copy of the descriptor, the reference count is decremented from 2 to 1. Since the kernel will not close a ﬁle until the reference counter in its ﬁle table goes to zero, the child’s end of the connection stays open. Problem 12.6 Solution: [Pg. 640] When a process terminates for any reason, the kernel closes all open descriptors. Thus, the child’s copy of the connected ﬁle descriptor will be closed automatically when the child exits. Problem 12.7 Solution: [Pg. 652] The reason that standard I/O works in CGI programs is that we never have to explicitly close the standard input and output streams. When the child exits, the kernel will close streams and their associated ﬁle descriptors automatically. Problem 12.8 Solution: [Pg. 662] A. The doit function is not reentrant, because it and its subfunctions use the non-reentrant readline function. B. To make Tiny reentrant, we must replace all calls to readline with its reentrant counterpart readline r, being carefull to call readline rinit in doit before the ﬁrst call to readline r. Bibliography
 K. Arnold and J. Gosling. The Java Programming Language. Addison-Wesley, 1996.  V. Bala, E. Duesterwald, and S. Banerjiia. Dynamo: A transparent dynamic optimization system. In Proceedings of the 1995 ACM Conference on Programming Language Design and Implementation (PLDI), pages 1–12, June 2000.  T. Berners-Lee, R. Fielding, and H. Frystyk. Hypert...
View Full Document