coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

split: prefer posix_spawn to fork and execl


From: Collin Funk
Subject: split: prefer posix_spawn to fork and execl
Date: Thu, 23 Oct 2025 01:25:48 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

I wrote this patch to have 'split' use posix_spawn.

While writing it I realized that the setup for posix_spawnattr_t and
posix_spawn_file_actions_t takes many lines to check for errors. My
assumption is that these functions will almost never fail. If they do,
it is probably because of ENOMEM.

Not checking for errors would be wrong because, for example, not
dup2'ing the pipe file descriptor to become standard input would make
the program behave incorrectly.

Therefore, I'm considering a xposix-spawnattr and
xposix-spawn-file-action Gnulib module. But I haven't decided yet.

Collin

Attachment: 0001-split-prefer-posix_spawn-to-fork-and-execl.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]