probleme de C

Top Page

Reply to this message
Author: Gregory Mounie
Date:  
To: guilde
Subject: probleme de C

Salut,

Ton programme ne specifie absolument pas ce qu'il dois faire une fois
qu'il a attrape le signal !

 Sous solaris, la semantique du read() est celle que tu attends
 (man read)
     If a read() is interrupted by a signal before it  reads  any
     data, it will return -1 with errno set to EINTR.


     If a read() is interrupted by a signal after it has success-
     fully  read  some  data,  it will return the number of bytes
     read.



 Sous linux, le man dis (il a tord, tu as raison) que 
       this may hap­
       pen for example because fewer bytes are actually available
       right  now (maybe because we were close to end-of-file, or
       because we are reading from a pipe, or from  a  terminal),
       or  because read() was interrupted by a signal.


mais je pense que le fichier info de la glibc 2(je ne l'ai pas sous la
main) dois indiquer que read ne retourne pas meme si il a recu
un signal par defaut. Son comportement doit etre reglable avec
ioctl()

Gregory