@@ -165,20 +165,19 @@ Below is a list of all ``popen`` functions and handle methods.
165
165
166
166
(if failure) ``nil, err ``
167
167
168
- Possible raised errors are :
168
+ Possible raised errors:
169
169
170
- * IllegalParams: incorrect type or value of a parameter
171
- * IllegalParams: group signal is set, while setsid is not
170
+ * `` IllegalParams `` : incorrect type or value of a parameter
171
+ * `` IllegalParams `` : group signal is set, while setsid is not
172
172
173
- Possible error reasons when ``nil, err `` is returned are :
173
+ Possible error reasons when ``nil, err `` is returned:
174
174
175
- * SystemError: dup(), fcntl(), pipe(), vfork() or close() fails in the
175
+ * `` SystemError `` : dup(), fcntl(), pipe(), vfork() or close() fails in the
176
176
parent process
177
- * SystemError: (temporary restriction) the parent process has closed stdin,
177
+ * `` SystemError `` : (temporary restriction) the parent process has closed stdin,
178
178
stdout or stderr
179
- * OutOfMemory: unable to allocate the handle or a temporary buffer
180
179
181
- Possible ``opts `` items are :
180
+ Possible ``opts `` items:
182
181
183
182
* ``opts.stdin `` (action on STDIN_FILENO)
184
183
* ``opts.stdout `` (action on STDOUT_FILENO)
@@ -252,14 +251,17 @@ Below is a list of all ``popen`` functions and handle methods.
252
251
| | | or when Lua GC collects the handle. |
253
252
+----------------------+----------------+-------------------------------------------+
254
253
255
-
256
254
The returned ``ph `` handle provides a
257
255
:ref: `popen_handle:close() <popen-close >` method for explicitly
258
256
releasing all occupied resources, including the child process
259
257
itself if ``opts.keep_child `` is not set). However, if the ``close() ``
260
258
method is not called for a handle during its lifetime, the
261
259
Lua GC will trigger the same freeing actions.
262
260
261
+ Since version 3.2.0, the ``inherit.fds `` option is added to the ``opts ``
262
+ table. The option allows define file descriptor numbers that should be
263
+ left open in the child process if the ``close_fds `` flag is set to ``true ``.
264
+
263
265
Tarantool recommends using ``opts.setsid `` plus ``opts.group_signal ``
264
266
if a child process may spawn its own children and if they should all
265
267
be killed together.
@@ -397,7 +399,7 @@ Below is a list of all ``popen`` functions and handle methods.
397
399
:ref: `popen.shell() <popen-shell >`
398
400
:param table opts: options
399
401
400
- Possible ``opts `` items are :
402
+ Possible ``opts `` items:
401
403
402
404
* ``opts.stdout `` (boolean, default ``true ``, if ``true `` then read from stdout)
403
405
* ``opts.stderr `` (boolean, default ``false ``, if ``true `` then read from stderr)
@@ -415,19 +417,18 @@ Below is a list of all ``popen`` functions and handle methods.
415
417
416
418
These errors are raised on incorrect parameters or when the fiber is cancelled:
417
419
418
- * IllegalParams: incorrect type or value of a parameter
419
- * IllegalParams: called on a closed handle
420
- * IllegalParams: opts.stdout and opts.stderr are both set
421
- * IllegalParams: a requested IO operation is not supported by
420
+ * `` IllegalParams `` : incorrect type or value of a parameter
421
+ * `` IllegalParams `` : called on a closed handle
422
+ * `` IllegalParams `` : opts.stdout and opts.stderr are both set
423
+ * `` IllegalParams `` : a requested IO operation is not supported by
422
424
the handle (stdout / stderr is not piped)
423
- * IllegalParams: attempt to operate on a closed file descriptor
424
- * FiberIsCancelled: cancelled by external code
425
+ * `` IllegalParams `` : attempt to operate on a closed file descriptor
426
+ * `` FiberIsCancelled `` : cancelled by external code
425
427
426
428
``nil, err `` is returned on following failures:
427
429
428
430
* SocketError: an IO error occurs at read()
429
431
* TimedOut: exceeded the opts.timeout quota
430
- * OutOfMemory: no memory space for a buffer to read into
431
432
* LuajitError: ("not enough memory"): no memory space for the Lua string
432
433
433
434
.. _popen-write :
0 commit comments