Fixes this warning:
```
WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: https://github.com/mesonbuild/meson/issues/9300
```
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
This simple patch includes signal.h in daemon/gamemode-context.c to fix building gamemode on musl
libc.
This has been tested Gentoo musl and Alpine (also Gentoo glibc to
ensure no multiple defined symbols/other errors for glibc).
> ../daemon/gamemode-context.c: In function 'game_mode_context_auto_expire':
> ../daemon/gamemode-context.c:421:29: error: implicit declaration of function 'kill' [-Werror=implicit-function-declaration]
> 421 | if (kill(client->pid, 0) != 0) {
> | ^~~~
> ../daemon/gamemode-context.c:421:29: warning: nested extern declaration of 'kill' [-Wnested-externs]
Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
Dockerfile
----------
This dockerfile was used to emulate GitHub actions.
<details><summary>Dockerfile source (click to expand)</summary>
```dockerfile
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN set -ex; \
apt-get update; \
apt-get install -y build-essential meson appstream clang clang-format clang-tools libdbus-1-dev libinih-dev libsystemd-dev git
RUN set -ex; \
yes | adduser ci-user
USER ci-user
```
</details>
Commands to reproduce
---------------------
I simulated GitHub actions with a local docker environment.
docker build -t ci .
I ran the following commands to reproduce the issue so that I could bugfix the static analyzer script.
```bash
docker run -e CI=true --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./scripts/static-analyser-check.sh
docker run -e CI=true --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./bootstrap.sh -Dwith-examples=true
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci meson test -C builddir
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci dbus-run-session -- gamemode-simulate-game
docker run --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./scripts/static-analyser-check.sh
```
All commands reuse the same workspace which is how it works in GH actions.
Legitimate bugs
---------------
Now the error displayed in build failure appears to be a legitimate bug. Four were found related to null pointer dereference. I'm not fixing the bug but the check should work properly for those who do.
If you following my docker setup in this description you can view the bug report by starting the report server.
```bash
docker run -p 127.0.0.1:8181:8181 -it --rm -v "$PWD:$PWD" -w "$PWD" --init ci scan-view --host 0.0.0.0 --allow-all-hosts builddir/meson-logs/scanbuild/*
```
After the report server is started you can visit `http://127.0.0.1:8181/` to view the bugs.
Screenshot of report
--------------------

This change fixes the format check in GitHub actions ran by `clang-format`.
Dockerfile
```dockerfile
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN set -ex; \
apt-get update; \
apt-get install -y build-essential meson appstream clang clang-format clang-tools libdbus-1-dev libinih-dev libsystemd-dev git
RUN set -ex; \
yes | adduser ci-user
USER ci-user
```
Environment setup
```bash
sudo su -g docker $USER
docker build -t ci .
```
clang-format fix
```bash
docker run -e CI=true --rm -v "$PWD:$PWD" -w "$PWD" --init ci ./scripts/format-check.sh
```
* New utility: gamemodelist
While trying out gamemode on Ubuntu 18.04 I had trouble figuring out
whether or not my games were running with gamemode enabled. I wrote this
utility which prints all processes loaded with the gamemode shared
library.
- [x] Added utility to `data/` folder.
- [x] Update meson installer.
- [x] Included section 1 manual.
- [x] Updated README for Ubuntu 18.04 build instructions. Steam supports
Ubuntu 18.04.
I'm open to feedback and generally this should work for any distrobution
since it makes use of the Linux `/proc` filesystem. [Learn more about
`/proc`][1].
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/filesystems/proc.rst?h=v5.15.12
Add a trivial gamemode.conf file, which creates the gamemode group.
v2: git add gamemode.conf (d'oh)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Not all distributions install non-system binaries into /usr/bin. For
example, NixOS installs packages to /nix/store using a unique hash
generated from the inputs used to build it:
/nix/store/jld7jh3ilvbg91zvn1bdyawfc55b9jk8-polkit-0.118-bin/bin/pkexec
The function `pidfds_to_pids` expected `-1` if `open_fdinfo_dir` failed but the latter returned `errno` which is hard to distinguish from a valid file handle. Correct that by making `open_fdinfo_dir` a wrapper around `open`.
Before it was installed to /etc, but according the daemon/gamemode-config.c line 381 the shipped config should be in /usr/share/gamemode
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Rename the pkg-config entry for libgamemodeauto, to it make it more that this will link against a library, compared to what the `gamemode` pkg-config does. This also removes the manual addition of the libdl dependency, this is done by Meson automatically.
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
This makes it more clear that libgamemode and libgamemodeauto are indeed libraries. Also, the misleading name `libgamemode_dep` has been renamed to `gamemode_dep`, which now also includes the dependency on libdl. The misleading `libgamemode_includes` variable name has also been changed.
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
Add a note for Nvidia hybrid graphics users, not having the opensource
nouveau driver, which can save them some time for searching the right
solution
Signed-off-by: Ahsan Hussain <ahsan_hussain@mentor.com>