| Summary: | implicit declaration of function ‘inotify_init1’ | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Rene Dudfield <renesd> |
| Component: | joystick | Assignee: | Ozkan Sezer <sezeroz> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | HG 2.0 | Keywords: | target-2.0.14 |
| Hardware: | x86 | ||
| OS: | Linux | ||
inotify_init1 man page says: "inotify_init1() was added in Linux 2.6.27; library support was added to glibc in version 2.9." https://man7.org/linux/man-pages/man2/inotify_init1.2.html I don't think anything can be done about CentOS5 (and I do know and like compatible 'manylinux' builds.) I can only suggest moving to CentOS-6.10 (which just hit its EOL) on which SDL2-2.0.14 builds just fine. Sam, Ryan? (In reply to Ozkan Sezer from comment #1) > I don't think anything can be done about CentOS5 (and I do > know and like compatible 'manylinux' builds.) I can only > suggest moving to CentOS-6.10 (which just hit its EOL) on > which SDL2-2.0.14 builds just fine. > > Sam, Ryan? Maybe something like the following though: diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -698,7 +698,7 @@ LINUX_JoystickInit(void) else #endif { -#ifdef HAVE_INOTIFY_H +#if defined(HAVE_INOTIFY_H) && defined(IN_NONBLOCK) inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); if (inotify_fd < 0) { Or maybe adding a configury check for inotify_init1()? Let's add a configure check for inotify_init1() and change the #define to HAVE_INOTIFY Ozkan, you want to take that for release? (In reply to Sam Lantinga from comment #3) > Let's add a configure check for inotify_init1() and change the #define > to HAVE_INOTIFY > > Ozkan, you want to take that for release? I did that and a bit more by providing a fallback when inotify_init1() isn't available: https://hg.libsdl.org/SDL/rev/d08f9559922f If all is good, we can close this. It compiles now. Thanks! However, I haven't been able to test it yet, because for some reason it's not building with threads support (I'll open a new bug for that). (In reply to Rene Dudfield from comment #5) > It compiles now. Thanks! And it does enable inotify (except for inotify_init1), yes? If yes, feel free to close this. > However, I haven't been able to test it yet, because for some reason > it's not building with threads support (I'll open a new bug for that). OK. This seems to have been fixed. Closing. |
I'm getting a build error on a Centos5 machine. I know it's very old... but this is used as the base for compatible 'manylinux' builds in python land. ---- /sdl_build/SDL2-2.0.14/src/joystick/linux/SDL_sysjoystick.c: In function ‘LINUX_JoystickInit’: /sdl_build/SDL2-2.0.14/src/joystick/linux/SDL_sysjoystick.c:702:9: warning: implicit declaration of function ‘inotify_init1’ [-Wimplicit-function-declaration] inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); ^ /sdl_build/SDL2-2.0.14/src/joystick/linux/SDL_sysjoystick.c:702:36: error: ‘IN_NONBLOCK’ undeclared (first use in this function) inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); ^ /sdl_build/SDL2-2.0.14/src/joystick/linux/SDL_sysjoystick.c:702:36: note: each undeclared identifier is reported only once for each function it appears in /sdl_build/SDL2-2.0.14/src/joystick/linux/SDL_sysjoystick.c:702:50: error: ‘IN_CLOEXEC’ undeclared (first use in this function) inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); ^ make: *** [build/SDL_sysjoystick.lo] Error 1 make: *** Waiting for unfinished jobs....