Preparation for hiding isolated processes

This commit is contained in:
topjohnwu
2020-12-30 15:55:53 -08:00
parent 3f9a64417b
commit 8e61080a4a
13 changed files with 271 additions and 216 deletions

View File

@@ -58,12 +58,6 @@ int gen_rand_str(char *buf, int len, bool varlen) {
return len - 1;
}
int strend(const char *s1, const char *s2) {
size_t l1 = strlen(s1);
size_t l2 = strlen(s2);
return strcmp(s1 + l1 - l2, s2);
}
int exec_command(exec_t &exec) {
int pipefd[] = {-1, -1};
int outfd = -1;
@@ -151,12 +145,6 @@ void set_nice_name(const char *name) {
prctl(PR_SET_NAME, name);
}
bool ends_with(const std::string_view &s1, const std::string_view &s2) {
unsigned l1 = s1.length();
unsigned l2 = s2.length();
return l1 < l2 ? false : s1.compare(l1 - l2, l2, s2) == 0;
}
/*
* Bionic's atoi runs through strtol().
* Use our own implementation for faster conversion.