From 4031c9428f386109bed00068023e395d0f9f7502 Mon Sep 17 00:00:00 2001 From: David Riley Date: Fri, 8 Jul 2022 13:23:23 -0700 Subject: [PATCH] drm-shim: Allow drm-shim to work with glibc fortify. Signed-off-by: David Riley Part-of: --- src/drm-shim/drm_shim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/drm-shim/drm_shim.c b/src/drm-shim/drm_shim.c index c7025edda42..940b42a3a12 100644 --- a/src/drm-shim/drm_shim.c +++ b/src/drm-shim/drm_shim.c @@ -293,6 +293,13 @@ PUBLIC int open(const char *path, int flags, ...) } PUBLIC int open64(const char*, int, ...) __attribute__((alias("open"))); +/* __open64_2 isn't declared unless _FORTIFY_SOURCE is defined. */ +PUBLIC int __open64_2(const char *path, int flags); +PUBLIC int __open64_2(const char *path, int flags) +{ + return open(path, flags, 0); +} + PUBLIC int close(int fd) { init_shim();