lsyncd/core/pipe.h
2018-03-26 19:05:00 +02:00

40 lines
737 B
C

/*
| pipe.h
|
| Manages the pipes used to communicate with spawned subprocesses (usually rsync).
|
| License: GPLv2 (see COPYING) or any later version
| Authors: Axel Kittenberger <axkibe@gmail.com>
*/
#ifndef LSYNCD_PIPE_H
#define LSYNCD_PIPE_H
/*
| Creates a pipe.
|
| Sets the write end non blocking and close on exec.
*/
extern void pipe_create(
int pipefd[ 2 ]
);
/*
| Writes to a pipe and handles observing for further writing
| if it's buffer is fully filled on first try.
|
| This may be used only once for every pipe manged by Lsyncd.
*/
extern void pipe_write(
int pipedf[ 2 ], // the pipe file descriptors
char const * pipe_text, // text to pipe
size_t pipe_len // the pipe's text length
);
#endif