Gio.SubprocessLauncher.prototype.take_stdin_fd
function take_stdin_fd(fd: Number(gint)): void { // Gjs wrapper for g_subprocess_launcher_take_stdin_fd() }
Sets the file descriptor to use as the stdin for spawned processes.
If fd is -1 then any previously given fd is unset.
Note that if your intention is to have the stdin of the calling process inherited by the child then Gio.SubprocessFlags.stdin_inherit is a better way to go about doing that.
The passed fd is noted but will not be touched in the current process. It is therefore necessary that it be kept open by the caller until the subprocess is spawned. The file descriptor will also not be explicitly closed on the child side, so it must be marked O_CLOEXEC if that's what you want.
You may not set a stdin fd if a stdin file path is already set or if the launcher flags contain any flags directing stdin elsewhere.
This feature is only available on UNIX.
Since 2.40
- fd
a file descriptor, or -1