thrd_sleep
Ken Brown
kbrown@cornell.edu
Fri Jan 29 00:51:30 GMT 2021
On 1/28/2021 6:36 PM, Rafał Jopek via Cygwin wrote:
> Hi,
>
> What package should be installed ?
>
> I use gcc under Cygwin:
> gcc (GCC) 10.2.0
> Copyright (C) 2020 Free Software Foundation, Inc.
>
> C11 standard (ISO/IEC 9899:2011):7.26.5.7
> The thrd_sleep function (p: 385)
>
> the code that compiles:
> ``` c
> #include <threads.h>
> #include <time.h>
> #include <stdio.h>
>
> int main(void)
> {
> printf("Time: %s", ctime(&(time_t){time(NULL)}));
> thrd_sleep(&(struct timespec){.tv_sec=1}, NULL);
> printf("Time: %s", ctime(&(time_t){time(NULL)}));
> }
> ```
> compile error:
> /usr/include/threads.h:30:10: fatal error: machine/_threads.h: No such file or directory
> 30 | #include <machine/_threads.h>
This has been fixed. You'll need to try a snapshot to get the fix. See
https://cygwin.com/pipermail/cygwin/2020-August/246070.html
Ken
More information about the Cygwin
mailing list