2018-03-26 17:05:00 +00:00
|
|
|
/*
|
2018-03-30 13:15:49 +00:00
|
|
|
| pipe.h from Lsyncd -- the Live (Mirror) Syncing Demon
|
2018-03-27 06:54:14 +00:00
|
|
|
|
|
2018-03-26 17:05:00 +00:00
|
|
|
| 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
|
|
|
|
|
2018-06-06 07:24:13 +00:00
|
|
|
|
2018-03-26 17:05:00 +00:00
|
|
|
/*
|
|
|
|
| Creates a pipe.
|
|
|
|
|
|
|
|
|
| Sets the write end non blocking and close on exec.
|
|
|
|
*/
|
2018-03-28 07:17:49 +00:00
|
|
|
extern void pipe_create( int pipefd[ 2 ] );
|
2018-03-26 17:05:00 +00:00
|
|
|
|
2018-06-06 07:24:13 +00:00
|
|
|
|
2018-03-26 17:05:00 +00:00
|
|
|
/*
|
|
|
|
| Writes to a pipe and handles observing for further writing
|
|
|
|
| if it's buffer is fully filled on first try.
|
|
|
|
|
|
2018-03-28 07:17:49 +00:00
|
|
|
| This may be used only once for every pipe managed by Lsyncd!
|
2018-03-26 17:05:00 +00:00
|
|
|
*/
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2018-06-06 07:24:13 +00:00
|
|
|
|
2018-03-26 17:05:00 +00:00
|
|
|
#endif
|