[PATCH] gpu/cuda: fix getenv related build error
Levend Sayar
levendsayar at gmail.com
Thu Aug 3 18:25:12 CEST 2023
If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1.
This causes gdrcopy.c build to give an error;
because compiler can not find signature of getenv.
stdlib.h is included for the definition of getenv function.
Fixes: ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters")
Signed-off-by: Levend Sayar <levendsayar at gmail.com>
---
drivers/gpu/cuda/gdrcopy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/cuda/gdrcopy.c b/drivers/gpu/cuda/gdrcopy.c
index 322a5dbeb2..bd56b73ce4 100644
--- a/drivers/gpu/cuda/gdrcopy.c
+++ b/drivers/gpu/cuda/gdrcopy.c
@@ -6,6 +6,8 @@
#ifdef DRIVERS_GPU_CUDA_GDRCOPY_H
+#include <stdlib.h>
+
static void *gdrclib;
static gdr_t (*sym_gdr_open)(void);
static int (*sym_gdr_pin_buffer)(gdr_t g, unsigned long addr, size_t size,
--
2.39.2 (Apple Git-143)
More information about the dev
mailing list