Blame support/process_state.h

Packit Bot 6310c7
/* Wait for process state.
Packit Bot 6310c7
   Copyright (C) 2020 Free Software Foundation, Inc.
Packit Bot 6310c7
   This file is part of the GNU C Library.
Packit Bot 6310c7
Packit Bot 6310c7
   The GNU C Library is free software; you can redistribute it and/or
Packit Bot 6310c7
   modify it under the terms of the GNU Lesser General Public
Packit Bot 6310c7
   License as published by the Free Software Foundation; either
Packit Bot 6310c7
   version 2.1 of the License, or (at your option) any later version.
Packit Bot 6310c7
Packit Bot 6310c7
   The GNU C Library is distributed in the hope that it will be useful,
Packit Bot 6310c7
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 6310c7
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Bot 6310c7
   Lesser General Public License for more details.
Packit Bot 6310c7
Packit Bot 6310c7
   You should have received a copy of the GNU Lesser General Public
Packit Bot 6310c7
   License along with the GNU C Library; if not, see
Packit Bot 6310c7
   <https://www.gnu.org/licenses/>.  */
Packit Bot 6310c7
Packit Bot 6310c7
#ifndef SUPPORT_PROCESS_STATE_H
Packit Bot 6310c7
#define SUPPORT_PROCESS_STATE_H
Packit Bot 6310c7
Packit Bot 6310c7
#include <sys/types.h>
Packit Bot 6310c7
Packit Bot 6310c7
enum support_process_state
Packit Bot 6310c7
{
Packit Bot 6310c7
  support_process_state_running      = 0x01,  /* R (running).  */
Packit Bot 6310c7
  support_process_state_sleeping     = 0x02,  /* S (sleeping).  */
Packit Bot 6310c7
  support_process_state_disk_sleep   = 0x04,  /* D (disk sleep).  */
Packit Bot 6310c7
  support_process_state_stopped      = 0x08,  /* T (stopped).  */
Packit Bot 6310c7
  support_process_state_tracing_stop = 0x10,  /* t (tracing stop).  */
Packit Bot 6310c7
  support_process_state_dead         = 0x20,  /* X (dead).  */
Packit Bot 6310c7
  support_process_state_zombie       = 0x40,  /* Z (zombie).  */
Packit Bot 6310c7
  support_process_state_parked       = 0x80,  /* P (parked).  */
Packit Bot 6310c7
};
Packit Bot 6310c7
Packit Bot 6310c7
/* Wait for process PID to reach state STATE.  It can be a combination of
Packit Bot 6310c7
   multiple possible states ('process_state_running | process_state_sleeping')
Packit Bot 6310c7
   where the function return when any of these state are observed.
Packit Bot 6310c7
   For an invalid state not represented by SUPPORT_PROCESS_STATE, it fallbacks
Packit Bot 6310c7
   to a 2 second sleep.  */
Packit Bot 6310c7
void support_process_state_wait (pid_t pid, enum support_process_state state);
Packit Bot 6310c7
Packit Bot 6310c7
#endif