LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2005, 03:57 PM   #1
Daniel_light
LQ Newbie
 
Registered: May 2005
Distribution: Mandrake 10.1
Posts: 1

Rep: Reputation: 0
Question Signal in C Linux


Hello any body, i new in the forum and i have a cuestion.

I write a program in C from red data form the serial port, i use the Linux Serial Programing How To, the data i read is asyncronus an i use singal from read data when it , the exaple in the how to work fine, but when i open more the one port i not can determine who file descriptor generate the signal in its case SIGIO, the porcion of the code its.
.
.
/* It is one from port */
saio.sa_handler = handler;
saio.sa_mask = 0;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,&saio,NULL)
.
.


void handler(){
read_data(fd);
}

thanks

Excusme my English
 
Old 05-29-2005, 04:56 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
have you considered looking into:
(1) whether or not it supports select (I doubt it)
(2) using threads & busy-wait

if 2 is an option: remember to sleep in the loop. I suggest with increasing durations, eventually hitting a constant upper bound.

hth --Jonas
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squid stops due to signal 6 and signal 25 simplyrahul Linux - Software 3 05-28-2011 01:05 AM
adding a new signal to linux linusclone Programming 1 04-23-2005 11:48 AM
signal levels linux vs. windows bclear Linux - Wireless Networking 2 12-06-2004 06:17 AM
Signal 6: Unknown Signal <=> Error with MAYA4.X under Linux SOLVED!!!! Faeroon Linux - Software 9 05-09-2003 01:57 PM
Signal: 6 (Unknown Signal) - Problems running a program Faeroon Linux - Software 86 01-14-2003 12:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration