Qsmtp  0.30dev
Functions
child.c File Reference

helper functions for interacting with Qsmtpds child processes More...

#include <qsmtpd/qsmtpd.h>
#include <errno.h>
#include <unistd.h>

Functions

int pipe_move (int p[2], int target)
 move the read end of the pipe to the target descriptor More...
 

Detailed Description

helper functions for interacting with Qsmtpds child processes

Function Documentation

int pipe_move ( int  p[2],
int  target 
)

move the read end of the pipe to the target descriptor

Parameters
pboth ends of the pipe
targetthe target descriptor of the read end
Returns
if everything went smooth
Return values
0everything is fine

This will move the read end of the pipe to target, closing both the write end of the pipe and the old read end of the pipe. This is intended to be called in the child process directly after forking, but before execve().