Clean up codes

This commit is contained in:
LoveSy
2023-04-08 11:56:39 +08:00
committed by topjohnwu
parent 9fbd079560
commit cbc6d40b2c
9 changed files with 2 additions and 366 deletions
-1
View File
@@ -4,7 +4,6 @@
#include "../files.hpp"
#include "../misc.hpp"
#include "../logging.hpp"
#include "../missing.hpp"
#include "../base-rs.hpp"
using rust::xpipe2;
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include <sys/syscall.h>
#include <linux/fcntl.h>
#include <unistd.h>
#include <cerrno>
#include <cstdio>
static inline int fexecve(int fd, char* const* argv, char* const* envp) {
syscall(__NR_execveat, fd, "", argv, envp, AT_EMPTY_PATH);
if (errno == ENOSYS) {
char buf[256];
ssprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
execve(buf, argv, envp);
}
return -1;
}
+1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <unistd.h>
#include <dirent.h>
#include <stdio.h>
#include <poll.h>