FoxiGram/TMessagesProj/jni/voip/webrtc/base/process/process_handle_linux.cc
instant992 8e79f2ee9c FoxiGram: Telegram client with built-in Xray VLESS proxy
Based on Nekogram. Key additions:
- Rebrand to FoxiGram (app name, APK name, applicationId com.foxigram.app)
- Embedded Xray (VLESS+Reality) proxy client via JNI libxray.so
- Bundled hidden one-tap proxies (LTE + WiFi), read-only in UI
- Auto-restore proxy on restart, rebind to active network (LTE/WiFi)
- Server credentials externalized to git-ignored XrayServers.java (+ template)
- libxray Go source included; compiled .so, keystore, google-services.json ignored
2026-06-08 16:41:07 +04:00

39 lines
1.1 KiB
C++

// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/process/process_handle.h"
#include "base/files/file_util.h"
#include "base/process/internal_linux.h"
#if defined(OS_AIX)
#include "base/process/internal_aix.h"
#endif
namespace base {
ProcessId GetParentProcessId(ProcessHandle process) {
ProcessId pid =
#if defined(OS_AIX)
internalAIX::ReadProcStatsAndGetFieldAsInt64(process,
internalAIX::VM_PPID);
#else
internal::ReadProcStatsAndGetFieldAsInt64(process, internal::VM_PPID);
#endif
// TODO(zijiehe): Returns 0 if |process| does not have a parent process.
if (pid)
return pid;
return -1;
}
FilePath GetProcessExecutablePath(ProcessHandle process) {
FilePath stat_file = internal::GetProcPidDir(process).Append("exe");
FilePath exe_name;
if (!ReadSymbolicLink(stat_file, &exe_name)) {
// No such process. Happens frequently in e.g. TerminateAllChromeProcesses
return FilePath();
}
return exe_name;
}
} // namespace base