Function | Package: excl | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 New since the initial 10.1 release.

## invalid-fd-close-on-fork-limit

Arguments: value

When Lisp starts a subordinate process using run-shell-command it generally closes all open file descriptors in the new process except stdin, stdout and stderr. It does this by cycling through the set of legal file descriptors trying to close each one. The overhead is generally insignificant given the low frequency and heavy cost of the operation as a whole.

However, this action (which can involve a sequence of 65000 or so system calls) can confuse some performance analysis tasks, particularly those involving strace. This function allows an application to limit the number of invalid-fd error returns accepted on closes of sequential fds during this operation. If that number of calls to close on sequentially increasing fds all return EBADF (bad file descriptor), the close loop terminates early, on the reasonable expectation that there are no more open fds.

The initial limit is a number big enough that it does not come into effect, so that the normal behavior is to attempt to close all fds after the three standard ones. invalid-fd-close-on-fork-limit allows inspection and modification of the limit.

The single argument to invalid-fd-close-on-fork-limit can have the following values:

- `nil`: invalid-fd-close-on-fork-limit returns the current limit without modifying anything.
- `t`: invalid-fd-close-on-fork-limit returns the maximum legal limit value, again without modifying the limit.
- an integer: any integer value >= to 1 and <= the maximum legal limit resets the limit to this value. The previous limit is returned.

Any other argument value, including integers less than 1 or greater than the maximum limit, cause an error to be signaled.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page is new in the 10.1 release.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 New since the initial 10.1 release.