This is an automated email from the ASF dual-hosted git repository.

yangzhg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e2c702c  remove some unused file for compatible to older kernels 
(#5568)
e2c702c is described below

commit e2c702c95923cf94d9f4b7405ff8dc6f35e71724
Author: Zhengguo Yang <[email protected]>
AuthorDate: Mon Mar 29 11:32:59 2021 +0800

    remove some unused file for compatible to older kernels (#5568)
---
 be/src/glibc-compatibility/musl/getrandom.c    | 23 ---------
 be/src/glibc-compatibility/musl/sched_getcpu.c | 71 --------------------------
 2 files changed, 94 deletions(-)

diff --git a/be/src/glibc-compatibility/musl/getrandom.c 
b/be/src/glibc-compatibility/musl/getrandom.c
deleted file mode 100644
index 32364ee..0000000
--- a/be/src/glibc-compatibility/musl/getrandom.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/** We have to replace glibc getrandom only when glibc version is higher than 
2.25.
- * In previous versions of glibc this function doesn't exist
- * and old kernels may be missing SYS_getrandom syscall.
- */
-#include <features.h>
-#if defined(__GLIBC__) && __GLIBC__ >= 2
-#   define GLIBC_MINOR __GLIBC_MINOR__
-#elif defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ >= 2
-#   define GLIBC_MINOR __GNU_LIBRARY_MINOR__
-#endif
-
-#if defined(GLIBC_MINOR) && GLIBC_MINOR >= 25
-
-#include <unistd.h>
-#include <syscall.h>
-#include "syscall.h"
-
-ssize_t getrandom(void *buf, size_t buflen, unsigned flags)
-{
-    /// There was cancellable syscall (syscall_cp), but I don't care too.
-    return syscall(SYS_getrandom, buf, buflen, flags);
-}
-#endif
diff --git a/be/src/glibc-compatibility/musl/sched_getcpu.c 
b/be/src/glibc-compatibility/musl/sched_getcpu.c
deleted file mode 100644
index 04e19fa..0000000
--- a/be/src/glibc-compatibility/musl/sched_getcpu.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#define _GNU_SOURCE
-#include <errno.h>
-#include <sched.h>
-#include "syscall.h"
-#include "atomic.h"
-
-#ifndef __NR_getcpu
-#if defined(__x86_64__)
-#define __NR_getcpu 309
-#elif defined(__i386__)
-#define __NR_getcpu 318
-#elif defined(__aarch64__)
-#define __NR_getcpu 168
-#endif
-#endif
-
-#ifndef SYS_getcpu
-#ifdef __NR_getcpu
-#define SYS_getcpu __NR_getcpu
-#endif
-#endif
-
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-#include <sanitizer/msan_interface.h>
-#endif
-#endif
-
-#ifdef VDSO_GETCPU_SYM
-
-static void *volatile vdso_func;
-
-typedef long (*getcpu_f)(unsigned *, unsigned *, void *);
-
-static long getcpu_init(unsigned *cpu, unsigned *node, void *unused)
-{
-       void *p = __vdsosym(VDSO_GETCPU_VER, VDSO_GETCPU_SYM);
-       getcpu_f f = (getcpu_f)p;
-       a_cas_p(&vdso_func, (void *)getcpu_init, p);
-       return f ? f(cpu, node, unused) : -ENOSYS;
-}
-
-static void *volatile vdso_func = (void *)getcpu_init;
-
-#endif
-
-int sched_getcpu(void)
-{
-       int r;
-       unsigned cpu = 0;
-
-#ifdef VDSO_GETCPU_SYM
-       getcpu_f f = (getcpu_f)vdso_func;
-       if (f) {
-               r = f(&cpu, 0, 0);
-               if (!r) return cpu;
-               if (r != -ENOSYS) return __syscall_ret(r);
-       }
-#endif
-
-       r = __syscall(SYS_getcpu, &cpu, 0, 0);
-       if (!r) {
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-        __msan_unpoison(&cpu, sizeof(cpu));
-#endif
-#endif
-        return cpu;
-    }
-       return __syscall_ret(r);
-}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to