rwrite

Name

rwrite -- 

Synopsis



void        rwrite_init                     (int _fd,
                                             pid_t _ppid);
void        rwrite_exit                     (void);
int         rwrite_write                    (alert_t *alert,
                                             int backup_on_error);

Description

Details

rwrite_init ()

void        rwrite_init                     (int _fd,
                                             pid_t _ppid);

Initialize the rwrite module.

_fd : A file descriptor to be used.
_ppid : The PID of the process where notification should be sent.


rwrite_exit ()

void        rwrite_exit                     (void);

Uninitialize the rwrite module. Further call to the rwrite_write() function will result the data being backuped.


rwrite_write ()

int         rwrite_write                    (alert_t *alert,
                                             int backup_on_error);

This function try to write a report to the file descriptor passed to the rwrite_init() function.

In case of error, the process specified in the rwrite_init() call, is notified by a SIGPIPE, telling it that the connection with the Report Server was eventually closed.

In case rwrite_exit() was called or if an error occur, and if the backup_on_error flag is set to TRUE, the report is backuped.

alert : The report to send.
backup_on_error : A flag specifying if data should be backuped on error.
Returns : 0 on success, -1 otherwise.