VirtualBox

Changeset 3138 in kBuild for vendor/gnumake/current/job.h


Ignore:
Timestamp:
Mar 12, 2018 7:32:29 PM (7 years ago)
Author:
bird
Message:

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/job.h

    r2596 r3138  
    11/* Definitions for managing subprocesses in GNU Make.
    2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
    3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
    4 Foundation, Inc.
     2Copyright (C) 1992-2016 Free Software Foundation, Inc.
    53This file is part of GNU Make.
    64
     
    1715this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1816
    19 #ifndef SEEN_JOB_H
    20 #define SEEN_JOB_H
     17#include "output.h"
    2118
    2219#ifdef HAVE_FCNTL_H
     
    2825/* How to set close-on-exec for a file descriptor.  */
    2926
    30 #if !defined F_SETFD
    31 # define CLOSE_ON_EXEC(_d)
     27#if !defined(F_SETFD) || !defined(F_GETFD)
     28# ifdef WINDOWS32
     29#  define CLOSE_ON_EXEC(_d)  process_noinherit(_d)
     30# else
     31#  define CLOSE_ON_EXEC(_d)
     32# endif
    3233#else
    3334# ifndef FD_CLOEXEC
     
    3738#endif
    3839
     40#ifdef NO_OUTPUT_SYNC
     41# define RECORD_SYNC_MUTEX(m) \
     42    O (error, NILF,                                                    \
     43       _("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
     44#else
     45# ifdef WINDOWS32
     46/* For emulations in w32/compat/posixfcn.c.  */
     47#  define F_GETFD 1
     48#  define F_SETLKW 2
     49/* Implementation note: None of the values of l_type below can be zero
     50   -- they are compared with a static instance of the struct, so zero
     51   means unknown/invalid, see w32/compat/posixfcn.c. */
     52#  define F_WRLCK 1
     53#  define F_UNLCK 2
     54
     55struct flock
     56  {
     57    short l_type;
     58    short l_whence;
     59    off_t l_start;
     60    off_t l_len;
     61    pid_t l_pid;
     62  };
     63
     64/* This type is actually a HANDLE, but we want to avoid including
     65   windows.h as much as possible.  */
     66typedef intptr_t sync_handle_t;
     67
     68/* Public functions emulated/provided in posixfcn.c.  */
     69int fcntl (intptr_t fd, int cmd, ...);
     70intptr_t create_mutex (void);
     71int same_stream (FILE *f1, FILE *f2);
     72
     73#  define RECORD_SYNC_MUTEX(m) record_sync_mutex(m)
     74void record_sync_mutex (const char *str);
     75void prepare_mutex_handle_string (intptr_t hdl);
     76# else  /* !WINDOWS32 */
     77
     78typedef int sync_handle_t;      /* file descriptor */
     79
     80#  define RECORD_SYNC_MUTEX(m) (void)(m)
     81
     82# endif
     83#endif  /* !NO_OUTPUT_SYNC */
     84
    3985/* Structure describing a running or dead child process.  */
    4086
    4187struct child
    4288  {
    43     struct child *next;         /* Link in the chain.  */
     89    struct child *next;         /* Link in the chain.  */
    4490
    45     struct file *file;          /* File being remade.  */
     91    struct file *file;          /* File being remade.  */
    4692
    47     char **environment;         /* Environment for commands.  */
     93    char **environment;         /* Environment for commands.  */
     94    char *sh_batch_file;        /* Script file for shell commands */
     95    char **command_lines;       /* Array of variable-expanded cmd lines.  */
     96    char *command_ptr;          /* Ptr into command_lines[command_line].  */
    4897
    49     char **command_lines;       /* Array of variable-expanded cmd lines.  */
    50     unsigned int command_line;  /* Index into above.  */
    51     char *command_ptr;          /* Ptr into command_lines[command_line].  */
     98#ifdef VMS
     99    char *comname;              /* Temporary command file name */
     100    int efn;                    /* Completion event flag number */
     101    int cstatus;                /* Completion status */
     102    int vms_launch_status;      /* non-zero if lib$spawn, etc failed */
     103#endif
    52104
    53     pid_t pid;                  /* Child process's ID number.  */
    54 #ifdef VMS
    55     int efn;                    /* Completion event flag number */
    56     int cstatus;                /* Completion status */
    57     char *comname;              /* Temporary command file name */
    58 #endif
    59     char *sh_batch_file;        /* Script file for shell commands */
    60     unsigned int remote:1;      /* Nonzero if executing remotely.  */
    61 
    62     unsigned int noerror:1;     /* Nonzero if commands contained a `-'.  */
    63 
    64     unsigned int good_stdin:1;  /* Nonzero if this child has a good stdin.  */
    65     unsigned int deleted:1;     /* Nonzero if targets have been deleted.  */
    66     unsigned int dontcare:1;    /* Saved dontcare flag.  */
     105    unsigned int  command_line; /* Index into command_lines.  */
     106    struct output output;       /* Output for this child.  */
     107    pid_t         pid;          /* Child process's ID number.  */
     108    unsigned int  remote:1;     /* Nonzero if executing remotely.  */
     109    unsigned int  noerror:1;    /* Nonzero if commands contained a '-'.  */
     110    unsigned int  good_stdin:1; /* Nonzero if this child has a good stdin.  */
     111    unsigned int  deleted:1;    /* Nonzero if targets have been deleted.  */
     112    unsigned int  recursive:1;  /* Nonzero for recursive command ('+' etc.)  */
     113    unsigned int  dontcare:1;   /* Saved dontcare flag.  */
    67114  };
    68115
    69116extern struct child *children;
    70117
     118/* A signal handler for SIGCHLD, if needed.  */
     119RETSIGTYPE child_handler (int sig);
    71120int is_bourne_compatible_shell(const char *path);
    72121void new_job (struct file *file);
     
    76125char **construct_command_argv (char *line, char **restp, struct file *file,
    77126                               int cmd_flags, char** batch_file);
     127
    78128#ifdef VMS
    79 int child_execute_job (char *argv, struct child *child);
    80 #elif defined(__EMX__)
    81 int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
     129int child_execute_job (struct child *child, char *argv);
    82130#else
    83 void child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
     131# define FD_STDIN       (fileno (stdin))
     132# define FD_STDOUT      (fileno (stdout))
     133# define FD_STDERR      (fileno (stderr))
     134int child_execute_job (struct output *out, int good_stdin, char **argv, char **envp);
    84135#endif
     136
    85137#ifdef _AMIGA
    86 void exec_command (char **argv);
     138void exec_command (char **argv) __attribute__ ((noreturn));
    87139#elif defined(__EMX__)
    88140int exec_command (char **argv, char **envp);
    89141#else
    90 void exec_command (char **argv, char **envp);
     142void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
    91143#endif
    92144
     
    97149void unblock_sigs (void);
    98150#else
    99 #ifdef  HAVE_SIGSETMASK
     151#ifdef  HAVE_SIGSETMASK
    100152extern int fatal_signal_mask;
    101 #define unblock_sigs()  sigsetmask (0)
     153#define unblock_sigs()  sigsetmask (0)
    102154#else
    103 #define unblock_sigs()
     155#define unblock_sigs()
    104156#endif
    105157#endif
    106158
    107159extern unsigned int jobserver_tokens;
    108 
    109 #endif /* SEEN_JOB_H */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette