Asterisk - The Open Source Telephony Project GIT-master-0bf3178
|
Alert Pipe API. More...
#include "asterisk.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/eventfd.h>
#include "asterisk/alertpipe.h"
#include "asterisk/logger.h"
Go to the source code of this file.
Functions | |
void | ast_alertpipe_close (int alert_pipe[2]) |
Close an alert pipe. More... | |
ast_alert_status_t | ast_alertpipe_flush (int alert_pipe[2]) |
Consume all alerts written to the alert pipe. More... | |
int | ast_alertpipe_init (int alert_pipe[2]) |
Initialize an alert pipe. More... | |
ast_alert_status_t | ast_alertpipe_read (int alert_pipe[2]) |
Read an event from an alert pipe. More... | |
ssize_t | ast_alertpipe_write (int alert_pipe[2]) |
Write an event to an alert pipe. More... | |
Alert Pipe API.
Definition in file alertpipe.c.
void ast_alertpipe_close | ( | int | alert_pipe[2] | ) |
Close an alert pipe.
alert_pipe | a two-element containing the alert pipe's file descriptors |
Definition at line 79 of file alertpipe.c.
References alert_pipe, and ast_alertpipe_clear().
Referenced by ast_alertpipe_init(), ast_channel_internal_alertpipe_close(), bridge_channel_destroy(), dealloc_signal(), and really_quit().
ast_alert_status_t ast_alertpipe_flush | ( | int | alert_pipe[2] | ) |
Consume all alerts written to the alert pipe.
alert_pipe | a two-element array containing the alert pipe's file descriptors |
AST_ALERT_READ_SUCCESS | on success |
AST_ALERT_NOT_READABLE | if the alert pipe is not readable |
AST_ALERT_READ_FATAL | if the alert pipe's file descriptors are in blocking mode, or a read error occurs. |
Definition at line 134 of file alertpipe.c.
References alert_pipe, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, LOG_WARNING, and tmp().
Referenced by ast_channel_internal_alert_flush().
int ast_alertpipe_init | ( | int | alert_pipe[2] | ) |
Initialize an alert pipe.
alert_pipe | a two-element array to hold the alert pipe's file descriptors |
non-zero | if a failure occurred. |
zero | otherwise. |
Definition at line 38 of file alertpipe.c.
References alert_pipe, ast_alertpipe_clear(), ast_alertpipe_close(), ast_fd_set_flags, ast_log, errno, and LOG_WARNING.
Referenced by alloc_signal(), ast_channel_internal_alertpipe_init(), asterisk_daemon(), and bridge_channel_internal_alloc().
ast_alert_status_t ast_alertpipe_read | ( | int | alert_pipe[2] | ) |
Read an event from an alert pipe.
alert_pipe | a two-element array containing the alert pipe's file descriptors |
AST_ALERT_READ_SUCCESS | on success |
AST_ALERT_NOT_READABLE | if the alert pipe is not readable |
AST_ALERT_READ_FATAL | if the alert pipe's file descriptors are in blocking mode, or a read error occurs. |
Definition at line 102 of file alertpipe.c.
References alert_pipe, AST_ALERT_NOT_READABLE, AST_ALERT_READ_FAIL, AST_ALERT_READ_SUCCESS, ast_alertpipe_readable(), ast_log, errno, LOG_WARNING, and tmp().
Referenced by ast_channel_internal_alert_read(), bridge_channel_handle_write(), monitor_sig_flags(), and wait_for_signal_or_hangup().
ssize_t ast_alertpipe_write | ( | int | alert_pipe[2] | ) |
Write an event to an alert pipe.
alert_pipe | a two-element array containing the alert pipe's file descriptors |
0 | Success |
1 | Failure |
Definition at line 120 of file alertpipe.c.
References alert_pipe, ast_alertpipe_writable(), errno, and tmp().
Referenced by __quit_handler(), _hup_handler(), ast_bridge_channel_queue_frame(), ast_channel_alert_write(), send_signal(), and wait_for_signal_or_hangup().