Add glibc symbols to glibc_compatibility

This commit is contained in:
BoloniniD 2022-08-23 21:26:19 +03:00
parent c7a6c4d56f
commit 78d00c3371
6 changed files with 79 additions and 1 deletions

View 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);
}

View 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];
};

View 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);
}

View 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;

View 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);
}

View File

@ -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})