1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
From a60f0658001d2e8e15ad980731d4130808d37d56 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 15 Dec 2022 12:58:57 -0800
Subject: [PATCH] Replace lseek64 with lseek
meson defined _FILE_OFFSET_BITS=64 unconditionally, this implies that
lseek and lseek64 are both same since they are using 64bit off_t,
replacing lseek64 with lseek also helps in compiling with latest musl C
library which has removed these from _GNU_SOURCE namespace unlike glibc
where _GNU_SOURCE also implies _LARGEFILE64_SOURCE and the definition of
lseek64 is still available.
Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1003]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/proxy/proxy_context.c | 2 +-
src/venus/vkr_context.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/proxy/proxy_context.c b/src/proxy/proxy_context.c
index f2a035b..f20f7c8 100644
--- a/src/proxy/proxy_context.c
+++ b/src/proxy/proxy_context.c
@@ -319,7 +319,7 @@ validate_resource_fd_shm(int fd, uint64_t expected_size)
return false;
}
- const uint64_t size = lseek64(fd, 0, SEEK_END);
+ const uint64_t size = lseek(fd, 0, SEEK_END);
if (size != expected_size) {
proxy_log("failed to validate shm size(%" PRIu64 ") expected(%" PRIu64 ")", size,
expected_size);
diff --git a/src/venus/vkr_context.c b/src/venus/vkr_context.c
index 9ecb9cd..1e5dc68 100644
--- a/src/venus/vkr_context.c
+++ b/src/venus/vkr_context.c
@@ -359,7 +359,7 @@ vkr_context_get_blob_locked(struct virgl_context *base,
return ret;
if (fd_type == VIRGL_RESOURCE_FD_DMABUF &&
- (uint64_t)lseek64(fd, 0, SEEK_END) < blob_size) {
+ (uint64_t)lseek(fd, 0, SEEK_END) < blob_size) {
close(fd);
return -EINVAL;
}
|