Open kloczek opened 2 years ago
hey, whats up
I had the same error or problem, the solution is to look for the file common-pidfds.c in the common folder, inside the gamemode folder in your personal folder, open the file and look for the line
int fd = pidfd_open(pid, 0);
and replace for this >>> int fd = fdopen(pid, 0);
static int pidfd_open(pid_t pid, unsigned int flags) { return (int)syscall(__NR_pidfd_open, pid, flags); }
/ pidfd functions / int open_pidfds(pid_t pids, int fds, int count) { int i = 0;
for (i = 0; i < count; i++) {
int pid = pids[i];
int fd = fdopen(pid, 0);
if (fd < 0)
break;
fds[i] = fd;
}
hello, I had the same problem, after I've change it like in the previous comment, when I use ./bootstrap.sh I get this error:
` + meson builddir --prefix=/usr --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user Directory already configured.
Just run your build command (e.g. ninja) and Meson will regenerate as necessary. If ninja fails, run "ninja reconfigure" or "meson --reconfigure" to force Meson to regenerate.
If build failures persist, run "meson setup --wipe" to rebuild from scratch using the same options as passed when configuring the build. To change option values, run "meson configure" instead.
and if I continue to install when I test it with gamemoded -t
I get:
` : Loading config
Loading config file [/usr/share/gamemode/gamemode.ini]
: Running tests
Segmentation fault (core dumped) `
Same here, getting a segfault, after compiling with fdopen
: Loading config Loading config file [/usr/share/gamemode/gamemode.ini] : Running tests
[1] 21099 segmentation fault (core dumped) gamemoded -t
I had the same error or problem, the solution is to look for the file common-pidfds.c in the common folder, inside the gamemode folder in your personal folder, open the file and look for the line
int fd = pidfd_open(pid, 0);
and replace for this >>> int fd = fdopen(pid, 0);
While this did compile for me, the resulting installation didn't work, e.g. if I activated Feral for a game in Lutris, the game wouldn't start properly.
What worked for me instead is to disable #if
check in the compiler directives for the definition of the pidf_open
function:
//#if !HAVE_FN_PIDFD_OPEN
#include <sys/syscall.h>
#ifndef __NR_pidfd_open
#define __NR_pidfd_open 434
#endif
static int pidfd_open(pid_t pid, unsigned int flags)
{
return (int)syscall(__NR_pidfd_open, pid, flags);
}
//#endif
I read around a bit and apparently the c compiler on your system may or may not provide the pidfd_open
wrapper function. Inside of meson.build
this is apparently accounted for by first checking if the c compiler has the function and then setting HAVE_FN_PIDFD_OPEN
presumably to false so that the function would get defined as part of common-pidfds.c
instead by refering directly to the system call rather than the wrapper.
Why that still falls through mystifies me and I lack expertise in C to tell but ultimately you can either force the function to get defined as above or as indicated in #410 try to use a different c compiler that exposes the wrapper.
Same here, getting a segfault, after compiling with fdopen
: Loading config Loading config file [/usr/share/gamemode/gamemode.ini] : Running tests
[1] 21099 segmentation fault (core dumped) gamemoded -t
did you ever fix this?
Same issue for me. compile fails on same error as op ; proposed workaround end in segfault.
Kubuntu 23.04
Looks like 1.7 build is failing with
-Werror=implicit-function-declaration