fune/ipc/chromium/src/base/set_process_title_linux.h
Jed Davis c48e55cb24 Bug 1851095 - Step 1: Modify process_title_linux to work in our context, and build it. r=nika,glandium
The major changes:

* Instead of importing `base::ReadFileToString`, which is used only to
  determine if a `/proc` pseudo-file contains more than a certain number
  of characters, we simply `read` enough to determine that information.

* Instead of importing `base::NoDestructor` and wrapping it around STL
  containers, we simply `strdup` the strings we need to copy out of
  the initial arg/env area.  (In theory this could set off LSan if the
  copied string later becomes unreachable, but in practice that doesn't
  seem to happen, and it's easily fixable if that changes.)

* Chromium copies only the environment strings and allows the argv
  strings to be overwritten; this may be safe for how they access the
  command line arguments but it may not be for us, so this patch changes
  it to copy all of the strings.

Differential Revision: https://phabricator.services.mozilla.com/D187634
2023-09-22 03:41:39 +00:00

12 lines
482 B
C

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BASE_PROCESS_TITLE_LINUX_H_
#define BASE_PROCESS_TITLE_LINUX_H_
void setproctitle(const char* fmt, ...);
void setproctitle_init(char** main_argv);
#endif // BASE_PROCESS_TITLE_LINUX_H_