Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

int pa_signal_init ( pa_mainloop_api api  ) 

Initialize the UNIX signal subsystem and bind it to the specified main loop

Definition at line 119 of file mainloop-signal.c.

References pa_mainloop_api::io_new, and PA_IO_EVENT_INPUT.

                                       {

    pa_assert(a);
    pa_assert(!api);
    pa_assert(signal_pipe[0] == -1);
    pa_assert(signal_pipe[1] == -1);
    pa_assert(!io_event);

    if (pipe(signal_pipe) < 0) {
        pa_log("pipe(): %s", pa_cstrerror(errno));
        return -1;
    }

    pa_make_fd_nonblock(signal_pipe[0]);
    pa_make_fd_nonblock(signal_pipe[1]);
    pa_make_fd_cloexec(signal_pipe[0]);
    pa_make_fd_cloexec(signal_pipe[1]);

    api = a;

    pa_assert_se(io_event = api->io_new(api, signal_pipe[0], PA_IO_EVENT_INPUT, callback, NULL));

    return 0;
}


Generated by  Doxygen 1.6.0   Back to index