| From 690eeef9590c7ef1d9d2c31d8c1d5d8071da8c4c Mon Sep 17 00:00:00 2001 |
| From: Chen Qi <Qi.Chen@windriver.com> |
| Date: Mon, 26 Feb 2018 17:21:11 +0800 |
| Subject: [PATCH 18/31] check for missing canonicalize_file_name |
| |
| Upstream-Status: Pending |
| |
| Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| --- |
| meson.build | 2 ++ |
| src/basic/missing_syscall.h | 6 ++++++ |
| 2 files changed, 8 insertions(+) |
| |
| diff --git a/meson.build b/meson.build |
| index 12811b3f3..f6515e97c 100644 |
| --- a/meson.build |
| +++ b/meson.build |
| @@ -520,6 +520,8 @@ foreach ident : [ |
| ['kcmp', '''#include <linux/kcmp.h>'''], |
| ['keyctl', '''#include <sys/types.h> |
| #include <keyutils.h>'''], |
| + ['canonicalize_file_name', '''#define _GNU_SOURCE |
| + #include <stdlib.h>'''], |
| ['copy_file_range', '''#include <sys/syscall.h> |
| #include <unistd.h>'''], |
| ['bpf', '''#include <sys/syscall.h> |
| diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h |
| index c938d0d97..308b9472b 100644 |
| --- a/src/basic/missing_syscall.h |
| +++ b/src/basic/missing_syscall.h |
| @@ -31,6 +31,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) { |
| } |
| #endif |
| |
| +#if !HAVE_CANONICALIZE_FILE_NAME |
| +static inline char *canonicalize_file_name(const char *path) { |
| + return realpath(path, NULL); |
| +} |
| +#endif |
| + |
| /* ======================================================================= */ |
| |
| #if !HAVE_MEMFD_CREATE |
| -- |
| 2.13.0 |
| |