code: def _posix_detached_subprocess(args: Sequence[str], **kwargs) -> int:
      # double fork and execute a subprocess so that there are no zombies
      read_end, write_end = os.pipe()
      pid = _fork_process()
      if pid > 0:  # in parent
          os.close(write_end)
          pid_str = os.read(read_end, 32).decode("utf8")
          os.close(read_end)
          return int(pid_str)
  
      proc = subprocess.Popen(
          args,
          shell=False,  # noqa: S603
          close_fds=True,
          **kwargs,
      )
      os.close(read_end)
      os.write(write_end, str(proc.pid).encode("utf8"))
      os.close(write_end)
  
      exit_code = proc.wait()
      os._exit(exit_code)
  
imports: import inspect
  import logging
  import os
  import subprocess
  import sys
  from contextlib import nullcontext
  from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Sequence, Union
  from dvc.log import logger
  from dvc.env import DVC_DAEMON, DVC_DAEMON_LOGFILE
  from dvc.utils import fix_env, is_binary
  from dvc.utils.collections import ensure_list
label_desc: Use image node_id 5 for calling a global function with example usage: _posix_detached_subprocess(args) and returns: int