!742 nweb set priority

Merge pull request !742 from wxt/nweb_priority
This commit is contained in:
openharmony_ci 2023-08-04 03:50:10 +00:00 committed by Gitee
commit cf8b1d46a2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,8 @@ pid_t NwebSpawnLanch()
pid_t ret = fork();
if (ret == 0) {
setcon("u:r:nwebspawn:s0");
pid_t pid = getpid();
setpriority(PRIO_PROCESS, pid, 0);
struct __user_cap_header_struct capHeader;
capHeader.version = _LINUX_CAPABILITY_VERSION_3;
capHeader.pid = 0;

View File

@ -17,6 +17,7 @@
#define NWEBSPAWNLANCHER_CPP
#include "selinux/selinux.h"
#include <sys/capability.h>
#include <sys/resource.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <sched.h>