Exposed pipe internals for windows fork

This commit is contained in:
Snaipe 2015-09-16 23:21:39 +02:00
parent 53f73ff938
commit ddc68c2e33
3 changed files with 40 additions and 11 deletions

View file

@ -0,0 +1,38 @@
/*
* The MIT License (MIT)
*
* Copyright © 2015 Franklin "Snaipe" Mathieu <http://snai.pe/>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef PIPE_INTERNAL_H_
# define PIPE_INTERNAL_H_
# include "internal.h"
# include "pipe.h"
struct pipe_handle {
#ifdef VANILLA_WIN32
HANDLE fhs[2];
#else
int fds[2];
#endif
};
#endif /* !PIPE_INTERNAL_H_ */

View file

@ -25,16 +25,7 @@
#include <csptr/smalloc.h>
#include "criterion/assert.h"
#include "pipe.h"
#include "internal.h"
struct pipe_handle {
#ifdef VANILLA_WIN32
HANDLE fhs[2];
#else
int fds[2];
#endif
};
#include "pipe-internal.h"
FILE *pipe_in(s_pipe_handle *p, int do_close) {
#ifdef VANILLA_WIN32

View file

@ -24,7 +24,7 @@
#include <csptr/smalloc.h>
#include "process.h"
#include "internal.h"
#include "pipe.h"
#include "pipe-internal.h"
#ifdef VANILLA_WIN32
# define CREATE_SUSPENDED_(Filename, CmdLine, StartupInfo, Info) \