This is a test file I ran so that I didnt need to run the build every time for 
wlroots. Compiled to exe file with "gcc -o checko test.c". Needs to have a file 
just called testfile to work
________________________________
Fra: christiano...@outlook.com <christiano...@outlook.com>
Sendt: tirsdag 18. juni 2024 17:07
Til: cygwin@cygwin.com <cygwin@cygwin.com>
Emne: Issue regarding SFD_CLOEXEC. error: "''O_CLOEXEC' undeclared here (not in 
a function); did you mean 'FD_CLOEXEC'?"

Hi, I am trying to build wlroots, but get this error in meson logs:
Command line: `cc 
/home/Chris/wlroots/build/meson-private/tmprxphcsub/testfile.c -o 
/home/Chris/wlroots/build/meson-private/tmprxphcsub/output.obj -c 
-D_FILE_OFFSET_BITS=64 -O0 -std=c11` -> 1
stderr:
In file included from 
/home/Chris/wlroots/build/meson-private/tmprxphcsub/testfile.c:2:
/usr/include/sys/signalfd.h:17:17: error: 'O_CLOEXEC' undeclared here (not in a 
function); did you mean 'FD_CLOEXEC'?
   17 |   SFD_CLOEXEC = O_CLOEXEC,
      |                              ^~~~~~~~~
      |                              FD_CLOEXEC
-----------
Header "sys/signalfd.h" has symbol "SFD_CLOEXEC" : NO

subprojects/wayland-1.20.0/meson.build:83:3: ERROR: Problem encountered: 
SFD_CLOEXEC is needed to compile Wayland libraries

 Is there any solution for this? Or is it a bug that needs to be fixed?
I am using Windows 10 Version 22H2 Build: 19045.3448.
CPU: Ryzen 5 2600
GPU: Nvidia RTX 2070
RAM: 32GB
#include <fcntl.h>
#include <stdio.h>

int main() {
    int fd = open("testfile", O_RDONLY);
    if (fd == -1) {
        perror("open");
        return 1;
    }

    int flags = fcntl(fd, F_GETFD);
    if (flags == -1) {
        perror("fcntl");
        return 1;
    }

    if (flags & FD_CLOEXEC) {
        printf("O_CLOEXEC is supported.\n");
    } else {
        printf("O_CLOEXEC is not supported.\n");
    }

    close(fd);
    return 0;
}
-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to