[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/nolibc: Fix remaining time in nanosleep



Hi Dafna,

On 09/04/2018 06:34 AM, Dafna Hirschfeld wrote:
I tired to implement it similar to the manual, according to the manual, -1 is returned if  the  call  is
interrupted by a signal handler.
If we decide to measure the time only if rem is non NULL, then the function could not return -1 if rem is NULL
and  the thread was waken up by another thread.

Ah, durr, of course. Ignore my comment. In that case, your patch is indeed the best we can do currently.

However, could you extend your patch to also set errno accordingly? It should be EINTR if we were interrupted. Also, while you're at it, nanosleep() should also return EINVAL if req->tv_nsec is below 0 or above 1000000000, i.e., req isn't "normalized". That would make it then fully compliant and we don't need to touch it again, unless we find a better solution for recognizing we got woken up at some point down the road.

I also have a few small comments that I missed the first time, which I sent in a separate mail. Could you have a look at them?

Thanks,
Florian

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.