|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/PTHREAD-EMBEDDED PATCH 2/2] Implement pthread_condattr_{getclock, setclock}
Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>
On Tue, Mar 31, 2020 at 5:08 PM Vlad-Andrei BĂDOIU
<vlad_andrei.badoiu@xxxxxxxxxxxxxxx> wrote:
>
> We adapt the implementation from musl.
>
> Signed-off-by: Vlad-Andrei BĂDOIU <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
> ---
> pthread_condattr.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/pthread_condattr.c b/pthread_condattr.c
> index 53dcc64..0861a53 100644
> --- a/pthread_condattr.c
> +++ b/pthread_condattr.c
> @@ -23,19 +23,20 @@
> #include <errno.h>
> #include <time.h>
> #include <pthread.h>
> -
> +#include <implement.h>
>
> int pthread_condattr_getclock(const pthread_condattr_t *__restrict attr,
> clockid_t *__restrict clock_id)
> {
> - WARN_STUBBED();
> - errno = ENOTSUP;
> - return -1;
> + *clock_id = (*attr)->clock & 0x7fffffff;
> + return 0;
> }
>
> int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
> {
> - WARN_STUBBED();
> - errno = ENOTSUP;
> - return -1;
> + if (clock_id < 0 || clock_id-2U < 2)
> + return EINVAL;
> + (*attr)->clock &= 0x80000000;
> + (*attr)->clock |= clock_id;
> + return 0;
> }
> --
> 2.20.1
>
>
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/minios-devel
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |