mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Add glibc symbols to glibc_compatibility
This commit is contained in:
parent
c7a6c4d56f
commit
78d00c3371
8
base/glibc-compatibility/musl/copy_file_range.c
Normal file
8
base/glibc-compatibility/musl/copy_file_range.c
Normal file
@ -0,0 +1,8 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <unistd.h>
|
||||
#include "syscall.h"
|
||||
|
||||
ssize_t copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags)
|
||||
{
|
||||
return syscall(SYS_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags);
|
||||
}
|
29
base/glibc-compatibility/musl/fstatat.c
Normal file
29
base/glibc-compatibility/musl/fstatat.c
Normal file
@ -0,0 +1,29 @@
|
||||
#define _BSD_SOURCE
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include "syscall.h"
|
||||
|
||||
struct statx {
|
||||
uint32_t stx_mask;
|
||||
uint32_t stx_blksize;
|
||||
uint64_t stx_attributes;
|
||||
uint32_t stx_nlink;
|
||||
uint32_t stx_uid;
|
||||
uint32_t stx_gid;
|
||||
uint16_t stx_mode;
|
||||
uint16_t pad1;
|
||||
uint64_t stx_ino;
|
||||
uint64_t stx_size;
|
||||
uint64_t stx_blocks;
|
||||
uint64_t stx_attributes_mask;
|
||||
struct {
|
||||
int64_t tv_sec;
|
||||
uint32_t tv_nsec;
|
||||
int32_t pad;
|
||||
} stx_atime, stx_btime, stx_ctime, stx_mtime;
|
||||
uint32_t stx_rdev_major;
|
||||
uint32_t stx_rdev_minor;
|
||||
uint32_t stx_dev_major;
|
||||
uint32_t stx_dev_minor;
|
||||
uint64_t spare[14];
|
||||
};
|
14
base/glibc-compatibility/musl/posix_spawnp.c
Normal file
14
base/glibc-compatibility/musl/posix_spawnp.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include "spawn.h"
|
||||
#include <features.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int posix_spawnp(pid_t *restrict res, const char *restrict file,
|
||||
const posix_spawn_file_actions_t *fa,
|
||||
const posix_spawnattr_t *restrict attr,
|
||||
char *const argv[restrict], char *const envp[restrict])
|
||||
{
|
||||
posix_spawnattr_t spawnp_attr = { 0 };
|
||||
if (attr) spawnp_attr = *attr;
|
||||
spawnp_attr.__fn = (void *)execvpe;
|
||||
return posix_spawn(res, file, fa, &spawnp_attr, argv, envp);
|
||||
}
|
19
base/glibc-compatibility/musl/spawn.h
Normal file
19
base/glibc-compatibility/musl/spawn.h
Normal file
@ -0,0 +1,19 @@
|
||||
#include <features.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
int __flags;
|
||||
pid_t __pgrp;
|
||||
sigset_t __def, __mask;
|
||||
int __prio, __pol;
|
||||
void *__fn;
|
||||
char __pad[64-sizeof(void *)];
|
||||
} posix_spawnattr_t;
|
||||
|
||||
typedef struct {
|
||||
int __pad0[2];
|
||||
void *__actions;
|
||||
int __pad[16];
|
||||
} posix_spawn_file_actions_t;
|
8
base/glibc-compatibility/musl/splice.c
Normal file
8
base/glibc-compatibility/musl/splice.c
Normal file
@ -0,0 +1,8 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#include "syscall.h"
|
||||
|
||||
long splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned flags)
|
||||
{
|
||||
return syscall(SYS_splice, fd_in, off_in, fd_out, off_out, len, flags);
|
||||
}
|
@ -74,7 +74,7 @@ function(build_cargo target_name project_dir)
|
||||
COMMENT ${compile_message}
|
||||
COMMAND export BUILD_FOR_OSX=${OSX_RUST_ROOT}
|
||||
COMMAND env CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} cargo rustc -v ${CARGO_RELEASE_FLAG} ${TARGET_SPEC_FLAG}
|
||||
COMMAND if [ ${TARGET_CP} = 0 ]\; then cp ${output_library} ${CMAKE_CURRENT_BINARY_DIR}\; else cp ./libblake_test/* ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_SPEC}/${TARGET_DIR}\; fi
|
||||
#COMMAND if [ ${TARGET_CP} = 0 ]\; then cp ${output_library} ${CMAKE_CURRENT_BINARY_DIR}\; else cp ./libblake_test/* ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_SPEC}/${TARGET_DIR}\; fi
|
||||
OUTPUT ${output_library}
|
||||
WORKING_DIRECTORY ${project_dir})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user