public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* thrd_sleep
@ 2021-01-28 23:36 Rafał Jopek
  2021-01-29  0:51 ` thrd_sleep Ken Brown
  2021-01-30 22:55 ` thrd_sleep Hans-Bernhard Bröker
  0 siblings, 2 replies; 3+ messages in thread
From: Rafał Jopek @ 2021-01-28 23:36 UTC (permalink / raw)
  To: cygwin

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>


- Rafał


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: thrd_sleep
  2021-01-28 23:36 thrd_sleep Rafał Jopek
@ 2021-01-29  0:51 ` Ken Brown
  2021-01-30 22:55 ` thrd_sleep Hans-Bernhard Bröker
  1 sibling, 0 replies; 3+ messages in thread
From: Ken Brown @ 2021-01-29  0:51 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: thrd_sleep
  2021-01-28 23:36 thrd_sleep Rafał Jopek
  2021-01-29  0:51 ` thrd_sleep Ken Brown
@ 2021-01-30 22:55 ` Hans-Bernhard Bröker
  1 sibling, 0 replies; 3+ messages in thread
From: Hans-Bernhard Bröker @ 2021-01-30 22:55 UTC (permalink / raw)
  To: cygwin

Am 29.01.2021 um 00:36 schrieb Rafał Jopek via Cygwin:
> Hi,
> 
> What package should be installed ?

None.  This is quite certainly a packaging mistake on a package you 
already have installed.

In short: that file should be in cygwin-devel, but it isn't.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-30 22:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 23:36 thrd_sleep Rafał Jopek
2021-01-29  0:51 ` thrd_sleep Ken Brown
2021-01-30 22:55 ` thrd_sleep Hans-Bernhard Bröker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).