Blame posix/spawn_int.h

Packit 6c4009
/* Internal definitions for posix_spawn functionality.
Packit 6c4009
   Copyright (C) 2000-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SPAWN_INT_H
Packit 6c4009
#define _SPAWN_INT_H
Packit 6c4009
Packit 6c4009
#include <spawn.h>
Packit 6c4009
#include <stdbool.h>
Packit 6c4009
Packit 6c4009
/* Data structure to contain the action information.  */
Packit 6c4009
struct __spawn_action
Packit 6c4009
{
Packit 6c4009
  enum
Packit 6c4009
  {
Packit 6c4009
    spawn_do_close,
Packit 6c4009
    spawn_do_dup2,
Packit 6c4009
    spawn_do_open
Packit 6c4009
  } tag;
Packit 6c4009
Packit 6c4009
  union
Packit 6c4009
  {
Packit 6c4009
    struct
Packit 6c4009
    {
Packit 6c4009
      int fd;
Packit 6c4009
    } close_action;
Packit 6c4009
    struct
Packit 6c4009
    {
Packit 6c4009
      int fd;
Packit 6c4009
      int newfd;
Packit 6c4009
    } dup2_action;
Packit 6c4009
    struct
Packit 6c4009
    {
Packit 6c4009
      int fd;
Packit 6c4009
      char *path;
Packit 6c4009
      int oflag;
Packit 6c4009
      mode_t mode;
Packit 6c4009
    } open_action;
Packit 6c4009
  } action;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
#define SPAWN_XFLAGS_USE_PATH	0x1
Packit 6c4009
#define SPAWN_XFLAGS_TRY_SHELL	0x2
Packit 6c4009
Packit 6c4009
extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
Packit 6c4009
					       file_actions)
Packit 6c4009
     attribute_hidden;
Packit 6c4009
Packit 6c4009
extern int __spawni (pid_t *pid, const char *path,
Packit 6c4009
		     const posix_spawn_file_actions_t *file_actions,
Packit 6c4009
		     const posix_spawnattr_t *attrp, char *const argv[],
Packit 6c4009
		     char *const envp[], int xflags) attribute_hidden;
Packit 6c4009
Packit 6c4009
/* Return true if FD falls into the range valid for file descriptors.
Packit 6c4009
   The check in this form is mandated by POSIX.  */
Packit 6c4009
bool __spawn_valid_fd (int fd) attribute_hidden;
Packit 6c4009
Packit 6c4009
#endif /* _SPAWN_INT_H */