[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    [uClinux-dev] Problem with interrupted nanosleep on MCF5329
From:       "Rottengatter, Peter" <Peter.Rottengatter () inteq ! com>
Date:       2007-08-27 15:27:00
Message-ID: 4244373FF2155241B4AEDE42D89F665DE006BB () MSGCELMBX ! ent ! bhicorp ! com
[Download RAW message or body]


Hi folx,

I'm trying to nanosleep on this MCF5329 board running 2.6.17. Ordinarily
I'd expect nanosleep to return 0 or -1 only, in the latter case setting
errno (that's what the man-page says). However, in this case it returns
-516, errno is 2 afterwards.

I need to handle signals during waiting. So I use the straight-forward
technique (async_act ist the global variable that is written to in the
signal handler)

   request.tv_sec  = seconds;
   request.tv_nsec = 0;

   while ((error=nanosleep (& request, & remain)) != 0)
      {
printf("returned:%d/%d\n",error,errno);
        if (errno != EINTR)
          {
             break;
           }
        switch (async_act)
          {
           ...
           }
        memcpy (& request, & remain, sizeof (struct timespec));
       }

which works on all sorts of platforms except this one. It waits OK as
long as no signal arrives. But a signal causes nanosleep to return with
value -516, which is documented nowhere. Is this a bug? Where in the
kernel code should I look for it?

Apologies for the footer, I cannot suppress it.

Regards

Peter Rottengatter
Baker Hughes INTEQ
Baker Hughes INTEQ GmbH
Baker-Hughes-Strasse 1, D - 29221 Celle
Tel.: +49 5141 203 0, Fax: +49 5141 203 296
Sitz der Gesellschaft: Celle, Amtsgericht Lueneburg HRB 100845
Geschaeftsfuehrer: Hermann Rathkamp, Ruediger Lichte, Friedhelm Makohl, Dr. \
Hans-Werner Hesse

Diese Nachricht ist ausschliesslich fuer die Person oder Organisation bestimmt, an \
die sie adressiert ist.   Sie kann herstellerspezifische, nur fuer bestimmte Personen \
bestimmte,  vertrauliche oder andere Informationen enthalten,  die kraft Gesetzes \
nicht offen gelegt werden muessen.  Wenn Sie nicht der in der Adresse genannte \
Empfaenger sind oder  versehentlich in der Adresszeile angesprochen werden, sind Sie \
nicht berechtigt, diese Nachricht oder Teile davon zu lesen,  zu drucken, \
aufzubewahren, zu kopieren oder zu verbreiten.  Sollten Sie diese Nachricht \
irrtuemlich erhalten haben,  benachrichtigen Sie bitte den Absender umgehend per \
Email und vernichten Sie saemtliche Kopien der Nachricht.   
This message is intended exclusively for the individual or entity to which it is \
addressed. This communication may contain  information that is proprietary, \
privileged or confidential or otherwise legally exempt from disclosure.  If you are \
not the named addressee, or have been inadvertently and erroneously referenced in the \
address line  you are not authorized to read, print, retain, copy or disseminate this \
message or any part of it.  If you have received this message in error, please notify \
the sender immediately by e-mail and delete all copies of the message. 

DISC-GER-A

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic