Thread: Signal generation and handling

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    7

    Signal generation and handling

    Hi,

    I'm using
    Code:
     int sigaction(int signum, const struct sigaction *act,struct sigaction *oldact);
    to register my realtime signal and the
    Code:
             void     (*sa_sigaction)(int, siginfo_t *, void *);
    callback handler to detect the availabilty of input data (si_code==POLL_IN) on my file descriptor(a serial port).

    My question is how often is the POLL_IN (i.e a SIGPOLL type) event generated by the kernel and is there someway i can suspend the signal generation for a certain time out? The problem that I'm facing is that the signal seems to be generated for every single character received on my port and my read() in the callback always reads only a byte or two.

    I don't want this to happen as i want to read a chunk of data in one go (which i KNOW is available for sure once the fist byte becomes available).

    Thanks.
    Ravi
    Last edited by itisravi; 03-22-2010 at 02:00 AM.

Popular pages Recent additions subscribe to a feed