]>
git.proxmox.com Git - mirror_smartmontools-debian.git/blob - os_win32/popen.h
4 * Home page of code is: https://www.smartmontools.org
6 * Copyright (C) 2018 Christian Franke
8 * SPDX-License-Identifier: GPL-2.0-or-later
14 #define POPEN_H_CVSID "$Id: popen.h 4818 2018-10-17 05:32:17Z chrfranke $"
18 // MinGW <stdio.h> defines these to _popen/_pclose
26 // popen(3) reimplementation for Windows
28 // The _popen() from MSVCRT is not useful as it always opens a new
29 // console window if parent process has none.
31 // Differences to popen(3):
32 // - Only modes "r[bt]" are supported
33 // - stdin and stderr from parent are not inherited to child process
34 // but redirected to null device
35 // - Only one child process can be run at a time
37 FILE * popen(const char * command
, const char * mode
);
45 // wait(3) macros from <sys/wait.h>
47 #define WIFEXITED(status) (((status) & 0xff) == 0x00)
48 #define WIFSIGNALED(status) (((status) & 0xff) != 0x00)
49 #define WIFSTOPPED(status) (0)
50 #define WEXITSTATUS(status) ((status) >> 8)
51 #define WTERMSIG(status) ((status) & 0xff)
52 #define WSTOPSIG(status) (0)