mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
cleanup (#764)
This commit is contained in:
1 parent
4163b31b02
commit
83ec5708ed
852 files changed
+4844
-46144
No files matched your search
@@ -1,29 +1,7 @@
|
||||
/*
|
||||
* Ported from WinNative (maxjivi05, feature/wayland-gamescope, 2026-09-18/19), GPL-3.0, with names
|
||||
* changed to this project's. The reasoning below is the original author's.
|
||||
*
|
||||
* The adjustments a session's opens need.
|
||||
*
|
||||
* O_NOATIME on the game library: the user's games are bound in from shared storage, which Android
|
||||
* serves over FUSE with every file owned by its media provider rather than by the app. O_NOATIME
|
||||
* is reserved for a file's owner, so the kernel refuses such an open outright with EPERM. The
|
||||
* Steam client opens every content file it reads that way, and treats the refusal as the file
|
||||
* being unreadable or missing: a validation reports corrupt or missing files and an update is
|
||||
* cancelled. The flag only asks the filesystem to skip an access-time update; the open is retried
|
||||
* without it. Every other refusal is passed through untouched, and a file the process may open
|
||||
* with the flag still is.
|
||||
*
|
||||
* The kernel's trace marker: tracefs is world-writable here, so the client's tier0 opens
|
||||
* /sys/kernel/tracing/trace_marker at startup - three times over, once per module that profiles -
|
||||
* and writes a "[%s] tgid=%d begin_ctx=%lld" line for every scope it enters. Nothing in the
|
||||
* session reads those markers, and they are one more thing that can land in the wrong file when
|
||||
* a descriptor number changes hands (tracer.c has the cause). They have been found appended to an
|
||||
* app manifest, which the client then cannot parse, to a download's state file, and to content
|
||||
* chunks, which it quarantines as corrupt. Refused the descriptor, tier0 writes nothing at all and
|
||||
* has nothing to lose.
|
||||
*
|
||||
* A process status is served without the container's tracer in it; see tracer.c.
|
||||
* Ported from WinNative (maxjivi05, feature/wayland-gamescope, 2026-09-18/19), GPL-3.0.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
@@ -55,7 +33,6 @@ static int retry_without_noatime(int fd, int flags) {
|
||||
return fd < 0 && errno == EPERM && (flags & O_NOATIME);
|
||||
}
|
||||
|
||||
/* Both spellings tier0 tries, the debugfs one first. */
|
||||
static int is_trace_marker(const char *path) {
|
||||
return path != NULL
|
||||
&& (strcmp(path, "/sys/kernel/tracing/trace_marker") == 0
|
||||
@@ -83,7 +60,6 @@ int open(const char *path, int flags, ...) {
|
||||
}
|
||||
fd = bl_dircache_create(AT_FDCWD, path, flags, mode, via_open);
|
||||
if (retry_without_noatime(fd, flags)) fd = real_open(path, flags & ~O_NOATIME, mode);
|
||||
/* A read-only file the Steam client rewrites (perms.c). */
|
||||
if (fd < 0 && bl_writable_retry(AT_FDCWD, path, flags)) fd = real_open(path, flags & ~O_NOATIME, mode);
|
||||
return fd;
|
||||
}
|
||||
@@ -113,6 +89,5 @@ int openat(int dirfd, const char *path, int flags, ...) {
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* The runtime is 64-bit, so the large-file names are the same calls. */
|
||||
int open64(const char *path, int flags, ...) __attribute__((alias("open")));
|
||||
int openat64(int dirfd, const char *path, int flags, ...) __attribute__((alias("openat")));
|
||||
Reference in new issue
Block a user