Explain how the F_DUPFD_CLOEXEC fcntl command might be useful.

What will be an ideal response?


he ?ag is useful in the prevention of leaking ?le descriptors in multithreaded programs. Assume one thread is duplicating a ?le descriptor by calling dup and about to set the close-on-exec ?ag using fcntl.Ifanother thread calls exec after the call to dup returns, but beforethe call to fcntl is made, then the new program executed will have access to a ?le descriptor which the original program had intended to prevent. The F_DUPFD_CLOEXEC ?ag closes this window,making the duplicating of the ?le descriptor and the setting of the closeon-exec ?ag an atomic operation

Computer Science & Information Technology

You might also like to view...

Which of the following statements removes all text from lstBox?

(A) lstBox.Clear() (B) lstBox.Items.Clear() (C) lstBox.Text.Clear() (D) lstBox.Items.Add("")

Computer Science & Information Technology

The ________ column displays your News Feed

A) fourth B) middle C) large middle D) left

Computer Science & Information Technology

What is the name of the most popular asymmetric encryption algorithm used today?

A) RSA B) AES C) RC4 D) MD5

Computer Science & Information Technology

What is the minimum RAM requirement to run Microsoft Virtual PC?

A) 1GB B) 1.5GB C) 2GB D) 512MB E) 4GB

Computer Science & Information Technology