aboutsummaryrefslogtreecommitdiff
path: root/jimiocompat.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-08wait: fix support for wait -1Steve Bennett1-6/+11
Only on unix systems. Does waitpid(-1, ...) to wait for any child process to exit. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14win32: Fix process handle vs pid distinctionSteve Bennett1-6/+38
On win32, a process is identified by a HANDLE, but for identifying a running process we should use GetProcessId() to return a meaningful integer. This means we need to be able to back and forth between a pid and a process handle (phandle). We also need to be careful to get the pid before the process handle closes since it isn't available afterwards. Also call the handle to intptr_t for open_osfhandle() to avoid a compiler warning. Fixes #217 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17signal, exec, wait, pid: improvements, especially to execSteve Bennett1-0/+214
- fix popen [open "|pipeline ..."] to return meaningful status in close (but note that stderr is not captured) - popen pipelines can now be used as the target of exec redirection - overally improvements to exec on windows. Now crt file descriptors are used throughout - add support for [pid], [wait] and popen on windows - os.wait is now wait, and integrates with [exec ... &] to be able to wait for running background tasks - [socket pipe] is now also [pipe] and is supported on windows - [file tempfile] is supported on windows - move duplicated code between jim-aio.c and jim-exec.c to jimiocompat.c - Fix [exec] on windows to match unix semantics wrt sharing the parent stream unless redirected rather than using /dev/null - On windows redirect to or from /dev/null is automatically converted to NUL: - If signal support is disabled, implement a minimal Jim_SignalId() for exec and wait - aio now supports getfd, to return the underlying file descriptor. This is used by exec to support redirection, and allows popen channels to support exec redirection. Signed-off-by: Steve Bennett <steveb@workware.net.au>