From: roland@gnu.ai.mit.edu (Roland McGrath)
Subject: gcc 2.1 cc1 fatal signal 11
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 14 Apr 1992 15:26:56 GMT

gcc 2.1 on hp300bsd (churchy.gnu.ai.mit.edu).

cc1 -quiet -dumpbase job.c -g -O -W -Wunused -Wpointer-arith -Wreturn-type -Wswitch -version -fstrength-reduce -o /usr/tmp/cc000331.s

on the following input gets signal 11:

# 1 "job.c"
 

















# 1 "make.h" 1
 

















# 1 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 1 3
 

















 






# 1 "/home/gd2/gnu/libc/hp300/ansi/features.h" 1 3
 





















 




































 









 







 



 





 








 











































# 26 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 2 3


# 1 "/home/gd2/gnu/libc/hp300/ansi/gnu/types.h" 1 3
 






















 
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
typedef struct { long val[2]; } __quad;
typedef struct { __u_long val[2]; } __u_quad;

typedef short int __dev_t;		 
typedef unsigned int __uid_t;		 
typedef unsigned int __gid_t;		 
typedef unsigned long int __ino_t;	 
typedef unsigned short int __mode_t;	 
typedef unsigned short int __nlink_t;	 
typedef long int __off_t;		 
typedef int __pid_t;			 
typedef int __ssize_t;			 


 
typedef long int __daddr_t;	 
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;	 



 

 


 




typedef struct
  {
    unsigned long int __bits[(256  + ((sizeof(unsigned long int) * 8)  - 1)) / (sizeof(unsigned long int) * 8) ];
  } __fd_set;

 








# 28 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 2 3





























# 1 "/home/gd2/gnu/libc/hp300/ansi/time.h" 1 3
 

















 



















# 47 "/home/gd2/gnu/libc/hp300/ansi/time.h" 3



















 
typedef __time_t time_t;





# 87 "/home/gd2/gnu/libc/hp300/ansi/time.h" 3



# 182 "/home/gd2/gnu/libc/hp300/ansi/time.h" 3



# 57 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 2 3



# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 






























 
typedef unsigned long int size_t;





# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3




# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 60 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 2 3












# 1 "/home/gd2/gnu/libc/hp300/ansi/gnu/time.h" 1 3
 






















 

struct __timeval
  {
    long int tv_sec;	 
    long int tv_usec;	 
  };

 
struct __timezone
  {
    int tz_minuteswest;	 
    int tz_dsttime;	 
  };


 
enum __itimer_which
  {
     
    ITIMER_REAL = 0,
     
    ITIMER_VIRTUAL = 1,
     

    ITIMER_PROF = 2,
  };

 

struct __itimerval
  {
     
    struct __timeval it_interval;
     
    struct __timeval it_value;
  };




# 72 "/home/gd2/gnu/libc/hp300/ansi/sys/types.h" 2 3


 




extern int __select(int __nfds, __fd_set *__readfds,
			    __fd_set *__writefds, __fd_set *__exceptfds,
			    struct __timeval *__timeout);







# 19 "make.h" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/sys/stat.h" 1 3
 

















 








# 1 "/home/gd2/gnu/libc/hp300/ansi/gnu/stat.h" 1 3
 























 
struct __stat
  {
    __dev_t st_dev;		 
    __ino_t st_ino;		 

    __mode_t st_mode;		 

    __nlink_t st_nlink;		 

     
    unsigned short int st_uid;	 
    unsigned short int st_gid;	 

    __dev_t st_rdev;		 

    __off_t st_size;		 

    __time_t st_atime;		 
    unsigned long int st_atime_usec;
    __time_t st_mtime;		 
    unsigned long int st_mtime_usec;
    __time_t st_ctime;		 
    unsigned long int st_ctime_usec;

    unsigned long int st_blksize; 
    unsigned long int st_blocks; 

    long int st_spare[2];
  };

 



 








 










# 28 "/home/gd2/gnu/libc/hp300/ansi/sys/stat.h" 2 3













 















 











 











 





 



 
extern int __stat(const char *__file, struct __stat *__buf);

 

extern int __fstat(int __fd, struct __stat *__buf);

 

extern int __lstat(const char *__file, struct __stat *__buf);

 


extern int __chmod(const char *__file, __mode_t __mode);

 
extern int __fchmod(int __fd, int __mode);


 

extern __mode_t __umask(__mode_t __mask);


 

extern __mode_t getumask(void);


 
extern int __mkdir(const char *__path, __mode_t __mode);

 


extern int __mknod(const char *__path, int __mode, int __dev);


















 
extern int mkfifo(const char *__path, __mode_t __mode);






# 20 "make.h" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/signal.h" 1 3
 

















 











# 1 "/home/gd2/gnu/libc/hp300/ansi/gnu/signal.h" 1 3
 


















 


# 1 "/home/gd2/gnu/libc/hp300/ansi/signum.h" 1 3
 



















 


 









 





































# 23 "/home/gd2/gnu/libc/hp300/ansi/gnu/signal.h" 2 3







typedef int __sig_atomic_t;

 


 
typedef unsigned long int __sigset_t;








 
typedef void (*__sighandler_t)(int);

 
struct __sigaction
  {
     
    __sighandler_t sa_handler;
    
     
    __sigset_t sa_mask;

     
    int sa_flags;
  };

 






# 31 "/home/gd2/gnu/libc/hp300/ansi/signal.h" 2 3




 

typedef __sig_atomic_t sig_atomic_t;





 

extern __sighandler_t signal(int __sig, __sighandler_t __handler);

 


extern __pid_t __kill(__pid_t __pid, int __sig);

extern int kill(int __pid, int __sig);






 


extern int killpg(int __pgrp, int __sig);


 
extern int raise(int __sig);


 
extern __sighandler_t ssignal(int __sig, __sighandler_t __handler);
extern int gsignal(int __sig);









 
extern int __sigblock(int __mask);

 
extern int __sigsetmask(int __mask);

 

extern int __sigpause(int __mask);




extern int sigblock(int __mask);
extern int sigsetmask(int __mask);
extern int sigpause(int __mask);





























 
extern int sigemptyset(__sigset_t  *__set);

 
extern int sigfillset(__sigset_t  *__set);

 
extern int sigaddset(__sigset_t  *__set, int __signo);

 
extern int sigdelset(__sigset_t  *__set, int __signo);

 
extern int sigismember(const __sigset_t  *__set, int signo);

 
extern int __sigprocmask(int __how, const __sigset_t  *__set,
				 __sigset_t  *__oset);
extern int sigprocmask(int __how, __sigset_t  *__set, __sigset_t  *__oset);

 





 

extern int sigsuspend(const __sigset_t  *__set);

 






 
extern int __sigaction(int __sig, const struct __sigaction *__act,
			       struct __sigaction *__oact);
extern int sigaction(int __sig, const struct __sigaction *__act,
			     struct __sigaction *__oact);



 
extern int sigpending(__sigset_t  *__set);















 
struct __sigvec
  {
    __sighandler_t sv_handler;	 
    int sv_mask;		 

    int sv_flags;		 

  };

 





 




extern int __sigvec(int __sig, const struct __sigvec *__vec,
			    struct __sigvec *__ovec);
extern int sigvec(int __sig, const struct __sigvec *__vec,
			  struct __sigvec *__ovec);



 


extern int siginterrupt(int __sig, int __interrupt);


 
struct sigstack
  {
    void * ss_sp;			 
    int ss_onstack;		 
  };

 

extern int sigstack(const struct sigstack *__ss,
			    struct sigstack *__oss);


 
# 1 "/home/gd2/gnu/libc/hp300/ansi/sigcontext.h" 1 3
 

















 
struct sigcontext
  {
    int sc_onstack;
    __sigset_t  sc_mask;

     
  };

 
# 236 "/home/gd2/gnu/libc/hp300/ansi/signal.h" 2 3


 
extern int __sigreturn(const struct sigcontext *__scp);
extern int sigreturn(const struct sigcontext *__scp);






# 21 "make.h" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/stdio.h" 1 3
 

















 











# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 





































# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3







 
 

 












# 31 "/home/gd2/gnu/libc/hp300/ansi/stdio.h" 2 3









 
typedef struct __stdio_file FILE;







 
typedef __off_t fpos_t;

 
typedef struct
  {
    unsigned int __read:1;	 
    unsigned int __write:1;	 
    unsigned int __append:1;	 
    unsigned int __binary:1;	 
    unsigned int __create:1;	 
    unsigned int __exclusive:1;	 
    unsigned int __truncate:1;	 
  } __io_mode;


 

typedef __ssize_t __io_read(void * __cookie, char *__buf,
				    size_t __nbytes);
typedef __ssize_t __io_write(void * __cookie, const char *__buf,
				     size_t __n);
typedef int __io_seek(void * __cookie, fpos_t *__pos, int __w);
typedef int __io_close(void * __cookie);

 
typedef struct
  {
    __io_read *__read;		 
    __io_write *__write;	 
    __io_seek *__seek;		 
    __io_close *__close;	 
  } __io_functions;

 
typedef struct
  {
     
    int (*__input)(FILE *__stream);
     
    void (*__output)(FILE *__stream, int __c);
  } __room_functions;

extern const __io_functions __default_io_functions;
extern const __room_functions __default_room_functions;


 
extern __io_close __stdio_close;
 
extern void * __stdio_open(const char *__file, __io_mode __m, int *__dp);
 
extern void __stdio_errmsg(const char *__msg, size_t __len);
 
extern char *__stdio_gen_tempname(const char *__dir, const char *__pfx,
					  int __dir_search, size_t *__lenptr);









 
extern __volatile  void __libc_fatal(const char *__message);


 
struct __stdio_file
  {
     

    int __magic;



    char *__bufp;			 
    char *__get_limit;			 
    char *__put_limit;			 
    char *__buffer;			 
    size_t __bufsize;			 
    FILE *__next;			 
    void * __cookie;			 
    int __fileno;			 
    unsigned char __pushback;		 
    char *__pushback_bufp;		 
    unsigned int __pushed_back:1;	 
    unsigned int __eof:1;		 
    unsigned int __error:1;		 
    unsigned int __userbuf:1;		 
    unsigned int __linebuf:1;		 
    unsigned int __seen:1;		 
    unsigned int __ispipe:1;		 
    __io_mode __mode;			 
    __io_functions __io_funcs;		 
    __room_functions __room_funcs;	 
    fpos_t __offset;			 
    fpos_t __target;			 
  };


 



 





 


 
extern void __invalidate(FILE *__stream);

 


extern int __stdio_check_offset(FILE *__stream);


 





 



 




 







 




 








# 1 "/home/gd2/gnu/libc/hp300/ansi/stdio_lim.h" 1 3








# 211 "/home/gd2/gnu/libc/hp300/ansi/stdio.h" 2 3



 

extern FILE *__stdio_head;	 

 
extern FILE *stdin, *stdout, *stderr;


 
extern int remove(const char *__filename);
 
extern int rename(const char *__old, const char *__new);


 
extern FILE *tmpfile(void);
 
extern char *tmpnam(char *__s);



 






extern char *tempnam(const char *__dir, const char *__pfx);



 

extern int __flshfp(FILE *__stream, int __c);


 
extern int fclose(FILE *__stream);
 
extern int fflush(FILE *__stream);


 
extern FILE *fopen(const char *__filename, const char *__modes);
 
extern FILE *freopen(const char *__filename,
			     const char *__modes, FILE *__stream);

 








extern FILE *__newstream(void);


 
extern FILE *fdopen(int __fd, const char *__modes);



 

extern FILE *fopencookie(void * __magic_cookie, const char *__modes,
				 __io_functions __io_functions);

 
extern FILE *fmemopen(void * __s, size_t __len, const char *__modes);

 


extern FILE *open_memstream(char **__bufloc, size_t *sizeloc);



 

extern void setbuf(FILE *__stream, char *__buf);
 


extern int setvbuf(FILE *__stream, char *__buf,
			   int __modes, size_t __n);


 

extern void	setbuffer(FILE *__stream, char *__buf, size_t __size);

 
extern void setlinebuf(FILE *__stream);



 
extern int fprintf(FILE *__stream, const char *__format, ...);
 
extern int printf(const char *__format, ...);
 
extern int sprintf(char *__s, const char *__format, ...);

 
extern int vfprintf(FILE *__s, const char *__format, void * __arg);
 
extern int vprintf(const char *__format, void * __arg);
 
extern int vsprintf(char *__s, const char *__format, void * __arg);






 
extern int snprintf(char *__s, size_t __maxlen,
			    const char *__format, ...);

extern int vsnprintf(char *__s, size_t __maxlen,
			     const char *__format, void * __arg);

 

extern int vasprintf(char **__ptr, const char *__f, void * __arg);
extern int asprintf(char **__ptr, const char *__fmt, ...);

 
extern int vdprintf(int __fd, const char *__fmt, void * __arg);
extern int dprintf(int __fd, const char *__fmt, ...);



 
extern int fscanf(FILE *__stream, const char *__format, ...);
 
extern int scanf(const char *__format, ...);
 
extern int sscanf(const char *__s, const char *__format, ...);


 
extern int __vfscanf(FILE *__s, const char *__format,
			     void * __arg);
extern int vfscanf(FILE *__s, const char *__format,
			   void * __arg);

 
extern int vscanf(const char *__format, void * __arg);

 
extern int __vsscanf(const char *__s, const char *__format,
			     void * __arg);
extern int vsscanf(const char *__s, const char *__format,
			   void * __arg);










 

extern int __fillbf(FILE *__stream);


 
extern int fgetc(FILE *__stream);
extern int getc(FILE *__stream);

 
extern int getchar(void);

 





 








 
extern int fputc(int __c, FILE *__stream);
extern int putc(int __c, FILE *__stream);

 
extern int putchar(int __c);

 









 









 
extern int getw(FILE *__stream);

 
extern int putw(int __w, FILE *__stream);



 
extern char *fgets(char *__s, size_t __n, FILE *__stream);

 

extern char *gets(char *__s);





 




__ssize_t  getdelim(char **lineptr, size_t *n,
			 int delimiter, FILE *stream);

 
__ssize_t  getline(char **lineptr, size_t *n, FILE *stream);







 
extern int fputs(const char *__s, FILE *__stream);
 
extern int puts(const char *__s);






 
extern int ungetc(int __c, FILE *__stream);


 
extern size_t fread(void * __ptr, size_t __size,
			    size_t __n, FILE *__stream);
 
extern size_t fwrite(const void * __ptr, size_t __size,
			     size_t __n, FILE *__s);


 
extern int fseek(FILE *__stream, long int __off, int __whence);
 
extern long int ftell(FILE *__stream);
 
extern void rewind(FILE *__stream);

 
extern int fgetpos(FILE *__stream, fpos_t *__pos);
 
extern int fsetpos(FILE *__stream, const fpos_t *__pos);


 
extern void clearerr(FILE *__stream);
 
extern int feof(FILE *__stream);
 
extern int ferror(FILE *__stream);







 
extern void perror(const char *__s);


 
extern void psignal(int __sig, const char *__s);




 
extern int fileno(const FILE *__stream);


 








 
extern FILE *popen(const char *__command, const char *__modes);

 
extern int pclose(FILE *__stream);




 
extern char *ctermid(char *__s);
 
extern char *cuserid(char *__s);





# 22 "make.h" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/ctype.h" 1 3
 

















 








 




enum
  {
    _ISupper	= 1 << 0,		 
    _ISlower	= 1 << 1,		 
    _IScntrl	= 1 << 2,		 
    _ISdigit	= 1 << 3,		 
    _ISspace	= 1 << 4,		 
    _IShex	= 1 << 5,		 
    _ISpunct	= 1 << 6,		 
    _NOgraph	= 1 << 7,		 
    _ISblank	= 1 << 8,		 
    _ISalpha	= _ISupper | _ISlower,	 
    _ISalnum	= _ISalpha | _ISdigit,	 
    _ISxdigit	= _ISdigit | _IShex,	 
    _ISgraph	= _ISalnum | _ISpunct,	 
    _ISprint	= _ISgraph | _NOgraph	 
  };

 

extern const unsigned short int *__ctype_b;	 
extern const unsigned char *__ctype_tolower;	 
extern const unsigned char *__ctype_toupper;	 









 



 



extern int isalnum(int) ;
extern int isalpha(int) ;
extern int iscntrl(int) ;
extern int isdigit(int) ;
extern int islower(int) ;
extern int isgraph(int) ;
extern int isprint(int) ;
extern int ispunct(int) ;
extern int isspace(int) ;
extern int isupper(int) ;
extern int isxdigit(int) ;


extern int isblank(int) ;



 
extern int tolower(int __c);

 
extern int toupper(int __c);




 

extern int isascii(int __c);

 

extern int toascii(int __c);




 
extern int _toupper(int) ;
extern int _tolower(int) ;






























# 23 "make.h" 2























# 1 "/home/gd2/gnu/libc/hp300/ansi/limits.h" 1 3
 

















 









 
# 1 "/home/gd2/gnu/libc/hp300/ansi/posix1_lim.h" 1 3
 

















 








 

 


 


 


 


 



 


 


 


 


 


 


 


 



 
# 1 "/home/gd2/gnu/libc/hp300/ansi/local_lim.h" 1 3
 











# 72 "/home/gd2/gnu/libc/hp300/ansi/posix1_lim.h" 2 3








 







# 30 "/home/gd2/gnu/libc/hp300/ansi/limits.h" 2 3




# 1 "/home/gd2/gnu/libc/hp300/ansi/posix2_lim.h" 1 3
 






















 


 


 


 


 



 



 


 




 






























# 34 "/home/gd2/gnu/libc/hp300/ansi/limits.h" 2 3



 


 


 



 



 






 








 



 


 



 






 



 




# 46 "make.h" 2




# 58 "make.h"


























# 1 "/home/gd2/gnu/libc/hp300/ansi/stdlib.h" 1 3
 

















 








 



# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 









































 







typedef	unsigned char	wchar_t;





# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 32 "/home/gd2/gnu/libc/hp300/ansi/stdlib.h" 2 3



# 1 "/home/gd2/gnu/libc/hp300/ansi/errno.h" 1 3
 

















 








 
# 1 "/home/gd2/gnu/libc/hp300/ansi/errnos.h" 1 3



























































































# 29 "/home/gd2/gnu/libc/hp300/ansi/errno.h" 2 3


 
extern volatile int errno;



# 35 "/home/gd2/gnu/libc/hp300/ansi/stdlib.h" 2 3


 

# 1 "/home/gd2/gnu/libc/hp300/ansi/float.h" 1 3
 

















 

























 
# 1 "/home/gd2/gnu/libc/hp300/ansi/fl.h" 1 3
 


   





















# 84 "/home/gd2/gnu/libc/hp300/ansi/fl.h" 3


 

 













  

# 136 "/home/gd2/gnu/libc/hp300/ansi/fl.h" 3

# 46 "/home/gd2/gnu/libc/hp300/ansi/float.h" 2 3









# 39 "/home/gd2/gnu/libc/hp300/ansi/stdlib.h" 2 3



 
typedef struct
  {
    int quot;	 
    int rem;	 
  } div_t;

 
typedef struct
  {
    long int quot;	 
    long int rem;	 
  } ldiv_t;


 



 





 




 
extern double atof(const char *__nptr);
 
extern int atoi(const char *__nptr);
 
extern long int atol(const char *__nptr);

 
extern double strtod(const char *__nptr, char **__endptr);
 
extern long int strtol(const char *__nptr, char **__endptr,
			       int __base);
 
extern unsigned long int strtoul(const char *__nptr,
					 char **__endptr, int __base);








 
extern int rand(void);
 
extern void srand(unsigned int __seed);

 



 
extern long int __random(void);
 
extern void __srandom(unsigned int __seed);

 



extern void * __initstate(unsigned int __seed, void * __statebuf,
			       size_t __statelen);
 

extern void * __setstate(void * __statebuf);


extern long int random(void);
extern void srandom(unsigned int __seed);
extern void * initstate(unsigned int __seed, void * __statebuf,
			     size_t __statelen);
extern void * setstate(void * __statebuf);















 
extern void * malloc(size_t __size);
 

extern void * realloc(void * __ptr, size_t __size);
 
extern void * calloc(size_t __nmemb, size_t __size);
 
extern void free(void * __ptr);	


 
extern void cfree(void * __ptr);







# 1 "/home/gd2/gnu/libc/hp300/ansi/alloca.h" 1 3
 






















# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 





































# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3




# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 24 "/home/gd2/gnu/libc/hp300/ansi/alloca.h" 2 3


 


 
extern void * __alloca(size_t __size);
extern void * alloca(size_t __size);










# 160 "/home/gd2/gnu/libc/hp300/ansi/stdlib.h" 2 3




 
extern void * valloc(size_t __size);












 
extern __volatile  void abort(void);


 
extern int atexit(void (*__func)(void));


 

extern int on_exit(void (*__func)(int __status, void * __arg),
			   void * __arg);


 


extern __volatile  void exit(int __status);


 
extern char *getenv(const char *__name);


 
 

extern int putenv(const char *__string);


 
extern int system(const char *__command);


 
typedef int (*__compar_fn_t) (const void *, const void *);





 

extern void * bsearch(const void * __key, const void * __base,
			   size_t __nmemb, size_t __size,
			   __compar_fn_t __compar);

 

extern void qsort(void * __base, size_t __nmemb, size_t __size,
			  __compar_fn_t __compar);




 







 
extern __const  int abs(int __x);
extern __const  long int labs(long int __x);







 

 
extern __const  div_t div(int __numer, int __denom);
extern __const  ldiv_t ldiv(long int __numer, long int __denom);


 

extern int mblen(const char *__s, size_t __n);
 

extern int mbtowc(wchar_t *__pwc, const char *__s, size_t __n);
 

extern int wctomb(char *__s, wchar_t __wchar);






 
extern size_t mbstowcs(wchar_t *__pwcs, const char *__s, size_t __n);
 
extern size_t wcstombs(char *__s, const wchar_t *__pwcs, size_t __n);



# 84 "make.h" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/string.h" 1 3
 

















 








 


# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 





































# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3




# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 31 "/home/gd2/gnu/libc/hp300/ansi/string.h" 2 3



 
extern void * memcpy(void * __dest, const void * __src, size_t __n);
 

extern void * memmove(void * __dest, const void * __src, size_t __n);

 


extern void * __memccpy(void * __dest, const void * __src,
			     int __c, size_t __n);

extern void * memccpy(void * __dest, const void * __src,
			   int __c, size_t __n);






 
extern void * memset(void * __s, int __c, size_t __n);

 
extern int memcmp(const void * __s1, const void * __s2, size_t __n);

 
extern void * memchr(const void * __s, int __c, size_t __n);


 
extern char *strcpy(char *__dest, const char *__src);
 
extern char *strncpy(char *__dest, const char *__src, size_t __n);

 
extern char *strcat(char *__src, const char *__dest);
 
extern char *strncat(char *__dest, const char *__src, size_t __n);

 
extern int  strcmp(const char *__s1, const char *__s2);
 
extern int strncmp(const char *__s1, const char *__s2, size_t __n);

 
extern int strcoll(const char *__s1, const char *__s2);
 
extern size_t strxfrm(char *__dest, const char *__src, size_t __n);


 
extern char *strdup(const char *__s);


 
extern char *strchr(const char *__s, int __c);
 
extern char *strrchr(const char *__s, int __c);

 

extern size_t strcspn(const char *__s, const char *__reject);
 

extern size_t strspn(const char *__s, const char *__accept);
 
extern char *strpbrk(const char *__s, const char *__accept);
 
extern char *strstr(const char *__needle, const char *__haystack);
 
extern char *strtok(char *__s, const char *__delim);


 


extern void * memmem(void * __needle, size_t __needle_len,
			  void * __haystack, size_t __haystack_len);


 
extern size_t strlen(const char *__s);

 
extern char *strerror(int __errnum);


 
extern int strcasecmp(const char *__s1, const char *__s2);



 
extern char *strsignal(int __sig);


 
extern char *stpcpy(char *__dest, const char *__src);



# 85 "make.h" 2


# 122 "make.h"

































 









extern void die ();
extern void message (), fatal (), error ();
extern void makefile_error (), makefile_fatal ();
extern void pfatal_with_name (), perror_with_name ();
extern char *savestring (), *concat ();
extern char *xmalloc (), *xrealloc ();
extern char *find_next_token (), *next_token (), *end_of_token ();
extern void collapse_continuations (), remove_comments ();
extern char *sindex (), *lindex ();
extern int alpha_compare ();
extern void print_spaces ();
extern struct dep *copy_dep_chain ();
extern char *find_percent ();


extern int ar_name ();
extern void ar_parse_name ();
extern int ar_touch ();
extern time_t ar_member_date ();


extern void dir_load ();
extern int dir_file_exists_p (), file_exists_p (), file_impossible_p ();
extern void file_impossible ();
extern char *dir_name ();

extern void define_default_variables ();
extern void set_default_suffixes (), install_default_implicit_rules ();
extern void convert_to_pattern (), count_implicit_rule_limits ();
extern void create_pattern_rule ();

extern void build_vpath_lists (), construct_vpath_list ();
extern int vpath_search ();

extern void construct_include_path ();
extern void uniquize_deps ();

extern int update_goal_chain ();
extern void notice_finished_file ();

extern void user_access (), make_access (), child_access ();











# 1 "/home/gd2/gnu/libc/hp300/ansi/unistd.h" 1 3
 

















 








 


 





 



 



 



 





 


























# 1 "/home/gd2/gnu/libc/hp300/ansi/posix_opt.h" 1 3





# 82 "/home/gd2/gnu/libc/hp300/ansi/unistd.h" 2 3



 





 








# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 





































# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3




# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 100 "/home/gd2/gnu/libc/hp300/ansi/unistd.h" 2 3



 






 
extern int __access(const char *__name, int __type);
extern int access(const char *__name, int __type);






 






 




extern __off_t __lseek(int __fd, __off_t __offset, int __whence);
extern __off_t lseek(int __fd, __off_t __offset, int __whence);

 
extern int __close(int __fd);
extern int close(int __fd);

 

extern __ssize_t  __read(int __fd, void * __buf, size_t __nbytes);
extern __ssize_t  read(int __fd, void * __buf, size_t __nbytes);

 
extern __ssize_t  __write(int __fd, const void * __buf, size_t __n);
extern __ssize_t  write(int __fd, const void * __buf, size_t __n);









 



extern int pipe(int __pipedes[2]);


 






extern unsigned int alarm(unsigned int __seconds);

 






extern unsigned int sleep(unsigned int __seconds);


 

extern int pause(void);


 
extern int chown(const char *__file ,
			 __uid_t __owner , __gid_t __group);


 
extern int fchown(int __fd , __uid_t __owner , __gid_t __group);


 
extern int chdir(const char *__path);

 






extern char *getcwd(char *__buf, size_t __size);


 


extern char *getwd(char *__buf);



 
extern int dup(int __fd);

 
extern int dup2(int __fd, int __fd2);


 
extern char **__environ;
extern char **environ;


 

extern int __execve(const char *__path, char *const __argv[],
			    char *const __envp[]);
extern int execve(const char *__path, char *const __argv[],
			  char *const __envp[]);



 
extern int execv(const char *__path, char *const __argv[]);





 

extern int execle(const char *__path, const char *__arg, ...);

 

extern int execl(const char *__path, const char *__arg, ...);

 

extern int execvp(const char *__file, char *const __argv[]);

 


extern int execlp(const char *__file, const char *arg, ...);











 
extern __volatile  void _exit(int __status);


 












 
extern long int __pathconf(const char *__path, int __name);
extern long int pathconf(const char *__path, int __name);

 
extern long int __fpathconf(int __fd, int __name);
extern long int fpathconf(int __fd, int __name);





 


enum
  {
    _SC_ARG_MAX,
    _SC_CHILD_MAX,
    _SC_CLK_TCK,
    _SC_NGROUPS_MAX,
    _SC_OPEN_MAX,
    _SC_STREAM_MAX,
    _SC_TZNAME_MAX,
    _SC_JOB_CONTROL,
    _SC_SAVED_IDS,
    _SC_VERSION,

     

    _SC_BC_BASE_MAX,
    _SC_BC_DIM_MAX,
    _SC_BC_SCALE_MAX,
    _SC_BC_STRING_MAX,
    _SC_EQUIV_CLASS_MAX,
    _SC_EXPR_NEST_MAX,
    _SC_LINE_MAX,
    _SC_RE_DUP_MAX,

    _SC_2_VERSION,
    _SC_2_C_BIND,
    _SC_2_C_DEV,
    _SC_2_FORT_DEV,
    _SC_2_SW_DEV
  };


 
extern long int sysconf(int __name);



 


 
extern size_t confstr(int __name, char *__buf, size_t __len);



 
extern __pid_t __getpid(void);
extern __pid_t getpid(void);

 
extern __pid_t __getppid(void);
extern __pid_t getppid(void);






 
extern __pid_t __getpgrp(__pid_t __pid);


 
extern __pid_t getpgrp(void);




 


extern int setpgid(__pid_t __pid, __pid_t __pgid);


 
extern int setpgrp(__pid_t __pid, __pid_t __pgrp);






 


extern __pid_t setsid(void);


 
extern __uid_t getuid(void);

 
extern __uid_t geteuid(void);

 
extern __gid_t getgid(void);

 
extern __gid_t getegid(void);

 


extern int getgroups(int __size, __gid_t __list[]);

 



extern int setuid(__uid_t __uid);


 

extern int __setreuid(__uid_t __ruid, __uid_t __euid);
extern int setreuid(__uid_t __ruid, __uid_t __euid);




 



extern int setgid(int __gid);


 

extern int __setregid(int __rgid, int __egid);
extern int setregid(int __rgid, int __egid);







 


extern __pid_t __fork(void);
extern __pid_t fork(void);




 



extern __pid_t __vfork(void);
extern __pid_t vfork(void);





 

extern char *ttyname(int __fd);

 

extern int __isatty(int __fd);
extern int isatty(int __fd);






 
extern int __link(const char *__from, const char *__to);
extern int link(const char *__from, const char *__to);



 
extern int symlink(const char *__from, const char *__to);

 


extern int readlink(const char *__path, char *__buf, size_t __len);


 
extern int __unlink(const char *__name);
extern int unlink(const char *__name);





 
extern int rmdir(const char *__path);


 
extern __pid_t tcgetpgrp(int __fd);

 
extern int tcsetpgrp(int __fd, __pid_t __pgrp_id);


 
extern char *getlogin(void);


 
extern int setlogin(const char *__name);




 
























extern int getopt(int __argc, char *const *__argv,
			  const char *__opts);
extern int opterr;
extern int optind;
extern int optopt;
extern char *optarg;




 


extern int __gethostname(char *__name, size_t __len);
extern int gethostname(char *__name, size_t __len);





 

extern int sethostname(const char *__name, size_t __len);

 
extern long int gethostid(void);

 

extern int sethostid(long int __id);


 

extern int __getpagesize(void);
extern int getpagesize(void);






 

extern int getdtablesize(void);


 
extern int fsync(int __fd);

 
extern int sync(void);


 


extern int vhangup(void);


 


extern int acct(const char *__name);

 

extern int chroot(const char *__path);

 

extern int swapon(const char *__path);




# 217 "make.h" 2


# 233 "make.h"










extern char *getwd ();










extern char **environ;

extern char *reading_filename;
extern unsigned int *reading_lineno_ptr;

extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
extern int print_directory_flag;

extern unsigned int job_slots;
extern double max_load_average;

extern char *program;

extern unsigned int makelevel;





# 19 "job.c" 2

# 1 "commands.h" 1
 
















 


struct commands
  {
    char *filename;		 
    unsigned int lineno;	 
    char *commands;		 
    unsigned int ncommand_lines; 
    char **command_lines;	 
    char *lines_recurse;	 
    char any_recurse;		 
  };


extern void execute_file_commands ();
extern void print_commands ();
extern void delete_child_targets ();
extern void chop_commands ();
# 20 "job.c" 2

# 1 "job.h" 1
 

struct child
  {
    struct child *next;		 

    struct file *file;		 

    char **environment;		 

    char **command_lines;	 
    unsigned int command_line;	 
    char *command_ptr;		 

    int pid;			 
    unsigned int remote:1;	 

    unsigned int noerror:1;	 

    unsigned int good_stdin:1;	 
    unsigned int deleted:1;	 
  };

extern struct child *children;

extern void new_job ();
extern void wait_for_children ();
extern void push_signals_blocked_p (), pop_signals_blocked_p ();

extern char **construct_command_argv ();
extern void child_execute_job ();
extern void exec_command ();

extern unsigned int job_slots_used;
# 21 "job.c" 2

# 1 "file.h" 1
 
















 



struct file
  {
    struct file *next;
    char *name;
    struct dep *deps;
    struct commands *cmds;	 
    char *stem;			 

    struct dep *also_make;	 
    time_t last_mtime;		 
    struct file *prev;		 



     

    struct file *renamed;

     
    struct variable_set_list *variables;

     

    struct file *parent;

    short int update_status;	 


    enum			 
      {		 
	cs_not_started,		 
	cs_deps_running,	 
	cs_running,		 
	cs_finished		 
      } command_state :2 ;

    unsigned int double_colon:1; 
    unsigned int precious:1;	 
    unsigned int tried_implicit:1; 


    unsigned int updating:1;	 
    unsigned int updated:1;	 
    unsigned int is_target:1;	 
    unsigned int cmd_target:1;	 
    unsigned int phony:1;	 

    unsigned int intermediate:1; 
    unsigned int dontcare:1;	 

  };

 

extern unsigned int num_intermediates;

extern struct file *default_goal_file, *suffix_file, *default_file;


extern struct file *lookup_file (), *enter_file ();
extern void remove_intermediates (), snap_deps ();
extern void rename_file ();


extern time_t f_mtime ();








# 22 "job.c" 2

# 1 "variable.h" 1
 
















 

enum variable_origin
  {
    o_default,		 
    o_env,		 
    o_file,		 
    o_env_override,	 
    o_command,		 
    o_override, 	 
    o_automatic,	 
    o_invalid		 
  };

 



struct variable
  {
    struct variable *next;	 
    char *name;			 
    char *value;		 
    enum variable_origin
      origin :3 ;	 
    unsigned int recursive:1;	 
    unsigned int expanding:1;	 
  };

 

struct variable_set
  {
    struct variable **table;	 
    unsigned int buckets;	 
  };

 

struct variable_set_list
  {
    struct variable_set_list *next;	 
    struct variable_set *set;		 
  };

extern struct variable_set_list *current_variable_set_list;


extern char *variable_buffer_output ();
extern char *initialize_variable_output ();
extern char *save_variable_output ();
extern void restore_variable_output ();

extern void push_new_variable_scope (), pop_variable_scope ();

extern int handle_function ();

extern char *variable_expand (), *allocated_variable_expand ();
extern char *variable_expand_for_file ();
extern char *allocated_variable_expand_for_file ();
extern char *expand_argument ();

extern void define_automatic_variables ();
extern void initialize_file_variables ();
extern void print_file_variables ();

extern void merge_variable_set_lists ();

extern int try_variable_definition ();

extern struct variable *lookup_variable (), *define_variable ();
extern struct variable *define_variable_for_file ();

extern int pattern_matches ();
extern char *subst_expand (), *patsubst_expand ();

extern char **target_environment ();
# 23 "job.c" 2



 
static char default_path[] = ":/bin:/usr/bin";

 
char default_shell[] = "/bin/sh";

extern int errno;




















# 1 "/home/gd2/gnu/libc/hp300/ansi/sys/wait.h" 1 3
 

















 









# 1 "/home/gd2/gnu/libc/hp300/ansi/gnu/wait.h" 1 3
 























 




 


 


 


 


 








 


 


 





# 29 "/home/gd2/gnu/libc/hp300/ansi/sys/wait.h" 2 3







 


union __wait
  {
# 49 "/home/gd2/gnu/libc/hp300/ansi/sys/wait.h" 3

    struct
      {
	unsigned int :16;
	unsigned int __w_retcode:8;
	unsigned int __w_coredump:1;
	unsigned int __w_termsig:7;
      } __wait_status;

  };













 


 

























 

extern __pid_t __wait(void *  __stat_loc);
extern __pid_t wait(void *  __stat_loc);


 




 











extern __pid_t __waitpid(__pid_t __pid, int *__stat_loc,
				 int __options);

 




extern __pid_t __wait3(union __wait *__stat_loc,
			       int __options, void * __usage);


 
extern __pid_t __wait4(__pid_t __pid, union __wait *__stat_loc,
			       int __options, void * __usage);








# 53 "job.c" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/sys/time.h" 1 3
 




























# 1 "/home/gd2/gnu/libc/hp300/ansi/time.h" 1 3
 

















 











 


# 1 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 1 3
 

















 





 





































# 77 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3




# 89 "/home/gd2/gnu/libc/hp300/ansi/stddef.h" 3











# 34 "/home/gd2/gnu/libc/hp300/ansi/time.h" 2 3






 













 
typedef long int clock_t;




# 69 "/home/gd2/gnu/libc/hp300/ansi/time.h" 3





 
struct tm
  {
    int tm_sec;		 
    int tm_min;		 
    int tm_hour;	 
    int tm_mday;	 
    int tm_mon;		 
    int tm_year;	 
    int tm_wday;	 
    int tm_yday;	 
    int tm_isdst;	 
  };




 

extern clock_t clock(void);

 
extern time_t time(time_t *__timer);

# 106 "/home/gd2/gnu/libc/hp300/ansi/time.h" 3


 
extern __const  double difftime(time_t __time1, time_t __time0);

 
extern time_t mktime(struct tm *__tp);


 


extern size_t strftime(char *__s, size_t __maxsize,
			       const char *__format, const struct tm *__tp);


 

extern struct tm *gmtime(const time_t *__timer);

 

extern struct tm *localtime(const time_t *__timer);

 

extern struct tm *__offtime(const time_t *__timer, long int __offset);






 

extern char *asctime(const struct tm *__tp);

 
extern char *ctime(const time_t *__timer);


 
extern char *__tzname[2];	 
extern int __daylight;		 
extern long int __timezone;	 

 

extern void __tzset(void);


 
extern char *tzname[2];


extern long int __tzname_max(void);

extern void tzset(void);






extern int daylight;
extern long int timezone;





 







# 30 "/home/gd2/gnu/libc/hp300/ansi/sys/time.h" 2 3












 





 




extern int __gettimeofday(struct __timeval *__tv,
				  struct __timezone *__tz);

 

extern int __settimeofday(const struct __timeval *__tv,
				  const struct __timezone *__tz);

 



extern int __adjtime(const struct __timeval *__delta,
			     struct __timeval *__olddelta);





 

extern int __getitimer(enum __itimer_which __which,
			       struct __itimerval *__value);

 


extern int __setitimer(enum __itimer_which __which,
			       struct __itimerval *__old,
			       struct __itimerval *__new);

 

extern int __utimes(const char *__file, struct __timeval __tvp[2]);









# 54 "job.c" 2

# 1 "/home/gd2/gnu/libc/hp300/ansi/sys/resource.h" 1 3
 

























 
enum __rlimit_resource
  {
     
    RLIMIT_CPU,
     
    RLIMIT_FSIZE,
     
    RLIMIT_DATA,
     
    RLIMIT_STACK,
     
    RLIMIT_CORE,
     



    RLIMIT_RSS,

    RLIM_NLIMITS
  };

struct rlimit
  {
     
    int rlim_cur;
     
    int rlim_max;
  };

 


 

int getrlimit(enum __rlimit_resource __resource,
		      struct rlimit *__rlimits);

 


int setrlimit(enum __rlimit_resource __resource,
		      struct rlimit *__rlimits);


 
enum __rusage_who
  {
     
    RUSAGE_SELF = 0,
     
    RUSAGE_CHILDREN = -1,
  };

 
struct rusage
  {
     
    struct __timeval ru_utime;
     
    struct __timeval ru_stime;
     
    int ru_maxrss;
     

    int ru_ixrss;
     
    int ru_idrss;
     
    int ru_isrss;
     

    int ru_minflt;
     
    int ru_majflt;
     
    int ru_nswap;
     

    int ru_inblock;
     
    int ru_oublock;
     
    int ru_msgsnd;
     
    int ru_msgrcv;
     
    int ru_nsignals;
     


    int ru_nvcsw;
     

    int ru_nivcsw;
  };

 

int __getrusage(enum __rusage_who __who, struct rusage *__usage);
int getrusage(enum __rusage_who __who, struct rusage *__usage);





 






long int __ulimit(int __cmd, long int __newlimit);
long int ulimit(int __cmd, long int __newlimit);






 



 

enum __priority_which
  {
    PRIO_PROCESS = 0,	 
    PRIO_PGRP = 1,	 
    PRIO_USER = 2,	 
  };

 



extern int getpriority(enum __priority_which __which, int __who);

 

extern int setpriority(enum __priority_which __which, int __who,
			       int __prio);



# 55 "job.c" 2

































# 101 "job.c"








# 118 "job.c"



extern int getdtablesize ();





extern void wait_to_start_job ();
extern int start_remote_job_p ();
extern int start_remote_job (), remote_status ();






extern char *sys_siglist[];


int child_handler ();
static void free_child (), start_job ();

 

struct child *children = 0;

 

unsigned int job_slots_used = 0;

 

static int good_stdin_used = 0;

 



static void
child_error (target_name, exit_code, exit_sig, coredump, ignored)
     char *target_name;
     int exit_code, exit_sig, coredump;
     int ignored;
{
  char *ignore_string = ignored ? " (ignored)" : "";

  if (exit_sig == 0)
    error ("*** [%s] Error %d%s", target_name, exit_code, ignore_string);
  else
    {
      char *coredump_string = coredump ? " (core dumped)" : "";
      if (exit_sig > 0 && exit_sig < 	32	 )
	error ("*** [%s] %s%s",
	       target_name, sys_siglist[exit_sig], coredump_string);
      else
	error ("*** [%s] Signal %d%s", target_name, exit_sig, coredump_string);
    }
}

extern void block_remote_children (), unblock_remote_children ();

extern int fatal_signal_mask;








 

static void
block_signals ()
{
# 205 "job.c"


   
  (void) __sigblock  (fatal_signal_mask | (1 << ((	20	) - 1))  );



  block_remote_children ();
}

 
static void
unblock_signals ()
{









   
  (void) __sigsetmask  (__sigblock  (0) & ~(fatal_signal_mask | (1 << ((	20	) - 1))  ));



  unblock_remote_children ();
}

static char *signals_blocked_p_stack = 0;
static unsigned int signals_blocked_p_max;
static unsigned int signals_blocked_p_depth;

 



void
push_signals_blocked_p (flag)
     int flag;
{
  int blocked;

  if (signals_blocked_p_stack == 0)
    {
      signals_blocked_p_max = 8;
      signals_blocked_p_stack = (char *) xmalloc (8);
      signals_blocked_p_depth = 1;
      signals_blocked_p_stack[0] = flag;

      blocked = 0;
    }
  else
    {
      if (signals_blocked_p_depth == signals_blocked_p_max)
	{
	  signals_blocked_p_max += 8;
	  signals_blocked_p_stack
	    = (char *) xrealloc(signals_blocked_p_stack,
				signals_blocked_p_max);
	}

      blocked = (signals_blocked_p_depth > 0
		 && signals_blocked_p_stack[signals_blocked_p_depth - 1]);

      signals_blocked_p_stack[++signals_blocked_p_depth - 1] = flag;
    }

  if (blocked && !flag)
    unblock_signals ();
  else if (flag && !blocked)
    block_signals ();
}

 


void
pop_signals_blocked_p ()
{
  int blocked, block;

  blocked = (signals_blocked_p_depth > 0
	     && signals_blocked_p_stack[signals_blocked_p_depth-- - 1]);

  block = (signals_blocked_p_depth > 0
	   && signals_blocked_p_stack[signals_blocked_p_depth - 1]);

  if (block && !blocked)
    block_signals ();
  else if (blocked && !block)
    unblock_signals ();
}

extern int shell_function_pid, shell_function_completed;

 










int
child_handler (sig)
     int sig;
{
  int  status;
  unsigned int dead_children = 0;

  if (sig > 0)
    block_signals ();

  while (1)
    {
      int remote = 0;
      register int pid;
      int exit_code, exit_sig, coredump;
      register struct child *lastc, *c;
      int child_failed;

       
      pid = remote_status (&exit_code, &exit_sig, &coredump, 0);
      if (pid < 0)
	{
	   


	  if (sig > 0)
	    pid = __wait3 ((union __wait  *) (&status), 	1	 , (struct rusage *) 0) ;
	  else
	    pid = __wait  (&status);









	  if (pid <= 0)
	     
	    break;
	  else
	    {
	       
	      exit_code = ((((__extension__ ({ union { __typeof(status) __in; int __i; } __u;	__u.__in = (status); __u.__i; })) ) & 0xff00) >> 8)  ;
	      exit_sig = (__extension__ ({ int __stat = ((__extension__ ({ union { __typeof(status) __in; int __i; } __u;	__u.__in = (status); __u.__i; })) );	!((((__extension__ ({ union { __typeof(__stat) __in; int __i; } __u;	__u.__in = (__stat); __u.__i; })) ) & 0xff) == 0x7f)   && !((((__extension__ ({ union { __typeof(__stat) __in; int __i; } __u;	__u.__in = (__stat); __u.__i; })) ) & 0x7f)  == 0)  ; }))   ? (((__extension__ ({ union { __typeof(status) __in; int __i; } __u;	__u.__in = (status); __u.__i; })) 
) & 0x7f)   : 0;
	      coredump = (((__extension__ ({ union { __typeof(status) __in; int __i; } __u;	__u.__in = (status); __u.__i; })) ) & 0200)  ;
	    }
	}
      else
	 
	remote = 1;

       
      if (!remote && pid == shell_function_pid)
	{
	   
	  if (exit_sig == 0 && exit_code == 127)
	    shell_function_completed = -1;
	  else
	    shell_function_completed = 1;

	   
	  ++dead_children;
	  if (sig < 0 && dead_children == -sig)
	    break;




	  else
	    continue;
	}

      child_failed = exit_sig != 0 || exit_code != 0;

       
      lastc = 0;
      for (c = children; c != 0; lastc = c, c = c->next)
	if (c->remote == remote && c->pid == pid)
	  break;

      if (c == 0)
	{
	   




	      char buf[100];
	      sprintf (buf, "Unknown%s job %d", remote ? " remote" : "", pid);
	      if (child_failed)
		child_error (buf, exit_code, exit_sig, coredump,
			     ignore_errors_flag);
	      else
		error ("%s finished.", buf);



	}
      else
	{
	   
	  if (c->good_stdin)
	    good_stdin_used = 0;

	  if (child_failed && !c->noerror && !ignore_errors_flag)
	    {
	       

	      child_error (c->file->name, exit_code, exit_sig, coredump, 0);
	      c->file->update_status = 1;
	      if (exit_sig != 0)
		delete_child_targets (c);
	    }
	  else
	    {
	      if (child_failed)
		{
		   
		  child_error (c->file->name,
			       exit_code, exit_sig, coredump, 1);
		  child_failed = 0;
		}

	       
	      start_job (c);

	      switch (c->file->command_state)
		{
		case cs_running:
		   
		  continue;

		case cs_finished:
		  if (c->file->update_status != 0)
		    {
		       
		      delete_child_targets (c);
		    }
		  break;

		default:
		  error ("internal error: `%s' command_state %d in child_handler", c->file->name);

		  abort ();
		  break;
		}
	    }

	   
	  notice_finished_file (c->file);

	   
	  if (lastc == 0)
	    children = c->next;
	  else
	    lastc->next = c->next;
	  free_child (c);

	   
	  --job_slots_used;

	   
	  if (child_failed && !keep_going_flag)
	    die (1);

	   
	  ++dead_children;
	  if (sig < 0 && dead_children == -sig)
	    break;




	}
    }






  if (sig > 0)
    unblock_signals ();

  return 0;
}


 




void
wait_for_children (n, err)
     unsigned int n;
     int err;
{
  push_signals_blocked_p (1);

  if (err && (children != 0 || shell_function_pid != 0))
    {
      fflush (stdout);
      error ("*** Waiting for unfinished jobs....");
    }

   
  (void) child_handler (- (int) n);

  pop_signals_blocked_p ();
}

 

static void
free_child (child)
     register struct child *child;
{
  if (child->command_lines != 0)
    {
      register unsigned int i;
      for (i = 0; i < child->file->cmds->ncommand_lines; ++i)
	free (child->command_lines[i]);
      free ((char *) child->command_lines);
    }

  if (child->environment != 0)
    {
      register char **ep = child->environment;
      while (*ep != 0)
	free (*ep++);
      free ((char *) child->environment);
    }

  free ((char *) child);
}

 


static void
start_job (child)
     register struct child *child;
{
  static int bad_stdin = -1;
  register char *p;
  char noprint = 0, recursive;
  char **argv;

  if (child->command_ptr == 0 || *child->command_ptr == '\0')
    {
       
      if (child->command_line == child->file->cmds->ncommand_lines)
	{
	   
	  child->command_ptr = 0;
	  child->file->command_state = cs_finished;
	  child->file->update_status = 0;
	  return;
	}
      else
	{
	   

	  child->command_ptr = child->command_lines[child->command_line];
	  recursive = child->file->cmds->lines_recurse[child->command_line];
	  ++child->command_line;
	}
    }
  else
     
    recursive = child->file->cmds->lines_recurse[child->command_line - 1];

  p = child->command_ptr;
  child->noerror = 0;
  while (*p != '\0')
    {
      if (*p == '@')
	noprint = 1;
      else if (*p == '-')
	child->noerror = 1;
      else if (*p == '+')
	recursive = 1;
      else if (!(__ctype_b[(*p)] & (unsigned short int)  _ISblank)  )
	break;
      ++p;
    }

   
  if (question_flag && !recursive)
    goto error;

   

  p = next_token (p);

   

  {
    char *end;
    argv = construct_command_argv (p, &end, child->file);
    if (end == ((void *) 0) )
      child->command_ptr = ((void *) 0) ;
    else
      {
	*end++ = '\0';
	child->command_ptr = end;
      }
  }

  if (argv == 0)
    {
       
      start_job (child);
      return;
    }

   

  if (just_print_flag || (!noprint && !silent_flag))
    ((fputs((p), stdout) || (( stdout)->__bufp < ( stdout)->__put_limit ? (int) (unsigned char) (*( stdout)->__bufp++ = (unsigned char) ('\n')) :	(( stdout)->__linebuf && ('\n') != '\n' &&	( stdout)->__bufp - ( stdout)->__buffer < ( stdout)->__bufsize) ?	(*( stdout)->__bufp++ = (unsigned char) ('\n')) :	__flshfp(( stdout), (unsigned char) ('\n')))  == (-1) ) ? (-1)  : 0) ;

   

  if (just_print_flag && !recursive)
    {
      free (argv[0]);
      free ((char *) argv);
      start_job (child);
      return;
    }

   

  fflush (stdout);
  fflush (stderr);
  
   

  if (bad_stdin == -1)
    {
       

      int pd[2];
      if (pipe (pd) == 0)
	{
	   
	  (void) 		__close(pd[1]) ;
	   
	  bad_stdin = pd[0];
	}
    }

   



  child->good_stdin = !good_stdin_used;
  if (child->good_stdin)
    good_stdin_used = 1;

  child->deleted = 0;

   
  if (child->environment == 0)
    child->environment = target_environment (child->file);

  if (start_remote_job_p ())
    {
      int is_remote, id, used_stdin;
      if (start_remote_job (argv, child->environment,
			    child->good_stdin ? 0 : bad_stdin,
			    &is_remote, &id, &used_stdin))
	goto error;
      else
	{
	  if (child->good_stdin && !used_stdin)
	    {
	      child->good_stdin = 0;
	      good_stdin_used = 0;
	    }
	  child->remote = is_remote;
	  child->pid = id;
	}
    }
  else
    {
      if (child->command_line - 1 == 0)
	{
	   

	  make_access ();
	  wait_to_start_job ();
	  user_access ();
	}

       

      child->remote = 0;
      child->pid = __vfork  ();
      if (child->pid == 0)
	 
	child_execute_job (child->good_stdin ? 0 : bad_stdin, 1,
			   argv, child->environment);
      else if (child->pid < 0)
	{
	   
	  perror_with_name ("vfork" , "");
	  goto error;
	}
    }

   


  child->file->command_state = cs_running;

   

  free (argv[0]);
  free ((char *) argv);

  return;

 error:;
  child->file->update_status = 1;
  child->file->command_state = cs_finished;
}


 

void
new_job (file)
     register struct file *file;
{
  register struct commands *cmds = file->cmds;
  register struct child *c;
  char **lines;
  register unsigned int i;

   
  chop_commands (cmds);

  if (job_slots != 0)
     
    while (job_slots_used == job_slots)
      wait_for_children (1, 0);

   
  lines = (char **) xmalloc (cmds->ncommand_lines * sizeof (char *));
  for (i = 0; i < cmds->ncommand_lines; ++i)
    lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i],
						   file);

   


  push_signals_blocked_p (1);

  c = (struct child *) xmalloc (sizeof (struct child));
  c->file = file;
  c->command_lines = lines;
  c->command_line = 0;
  c->command_ptr = 0;
  c->environment = 0;
  start_job (c);
  switch (file->command_state)
    {
    case cs_running:
      c->next = children;
      children = c;
       
      ++job_slots_used;
      break;

    case cs_finished:
      free_child (c);
      notice_finished_file (file);
      break;

    default:
      error ("internal error: `%s' command_state == %d in new_job",
	     file->name, (int) file->command_state);
      abort ();
      break;
    }

  pop_signals_blocked_p ();

  if (job_slots == 1 && file->command_state == cs_running)
    {
       

      while (file->command_state != cs_finished)
	wait_for_children (1, 0);
    }
}

 



void
child_execute_job (stdin_fd, stdout_fd, argv, envp)
     int stdin_fd, stdout_fd;
     char **argv, **envp;
{
  if (stdin_fd != 0)
    (void) dup2 (stdin_fd, 0);
  if (stdout_fd != 1)
    (void) dup2 (stdout_fd, 1);

   
  {
    register int d;
    int max = getdtablesize ();
    for (d = 3; d < max; ++d)
      (void) 		__close(d) ;
  }

   
  unblock_signals ();

   
  exec_command (argv, envp);
}

 



static int
search_path (file, path, program)
     char *file, *path, *program;
{
  if (path == 0 || path[0] == '\0')
    path = default_path;

  if (strchr((file), ( '/'))  != 0)
    {
      strcpy (program, file);
      return 1;
    }
  else
    {
      unsigned int len;



      extern int getgroups ();

      static int ngroups = -1;

      static __gid_t   groups[16 ];

# 880 "job.c"

      if (groups != 0 && ngroups == -1)
	ngroups = getgroups (16  , groups);


      len = strlen (file) + 1;
      do
	{
	  struct __stat  st;
	  int perm;
	  char *p;

	  p = strchr((path), ( ':')) ;
	  if (p == 0)
	    p = path + strlen (path);

	  if (p == path)
	    memcpy (( program), (file), ( len)) ;
	  else
	    {
	      memcpy (( program), (path), ( p - path)) ;
	      program[p - path] = '/';
	      memcpy (( program + (p - path) + 1), (file), ( len)) ;
	    }

	  if (__stat  (program, &st) == 0
	      && ((((st.st_mode)) & 0170000	) == ( 0100000	))  )
	    {
	      if (st.st_uid == geteuid ())
		perm = (st.st_mode & 0100);
	      else if (st.st_gid == getegid ())
		perm = (st.st_mode & 0010);
	      else
		{

		  register int i;
		  for (i = 0; i < ngroups; ++i)
		    if (groups[i] == st.st_gid)
		      break;
		  if (i < ngroups)
		    perm = (st.st_mode & 0010);
		  else

		    perm = (st.st_mode & 0001);
		}

	      if (perm != 0)
		return 1;
	    }

	  path = p + 1;
	} while (*path != '\0');
    }

  return 0;
}

 


void
exec_command (argv, envp)
     char **argv, **envp;
{
  char *shell, *path;
  char program[1024 ] ;
  register char **ep;

  shell = path = 0;
  for (ep = envp; *ep != 0; ++ep)
    {
      if (shell == 0 && !strncmp(*ep, "SHELL=", 6))
	shell = &(*ep)[6];
      else if (path == 0 && !strncmp(*ep, "PATH=", 5))
	path = &(*ep)[5];
      else if (path != 0 && shell != 0)
	break;
    }

   
  child_access ();

  if (!search_path (argv[0], path, program))
    error ("%s: Command not found", argv[0]);
  else
    {
       
      __execve  (program, argv, envp);

      if (errno == 8 )
	{
	  char shell_program[1024 ] ;
	  char *shell_path;
	  if (shell == 0)
	    shell_path = default_shell;
	  else
	    {
	      if (search_path (shell, path, shell_program))
		shell_path = shell_program;
	      else
		{
		  shell_path = 0;
		  error ("%s: Shell program not found", shell);
		}
	    }

	  if (shell_path != 0)
	    {
	      char **new_argv;
	      int argc;

	      argc = 1;
	      while (argv[argc] != 0)
		++argc;

	      new_argv = (char **) __builtin_alloca ((1 + argc + 1) * sizeof (char *)) ;
	      new_argv[0] = shell_path;
	      new_argv[1] = program;
	      while (argc > 0)
		{
		  new_argv[1 + argc] = argv[argc];
		  --argc;
		}

	      __execve  (shell_path, new_argv, envp);
	      perror_with_name ("execve: ", shell_path);
	    }
	}
      else
	perror_with_name ("execve: ", program);
    }

  _exit (127);
}

 











static char **
construct_command_argv_internal (line, restp, shell, ifs)
     char *line, **restp;
     char *shell, *ifs;
{
  static char sh_chars[] = "#;\"*?[]&|<>(){}=$`";
  static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
			     "logout", "set", "umask", "wait", "while", "for",
			     "case", "if", ":", ".", "break", "continue",
			     "export", "read", "readonly", "shift", "times",
			     "trap", "switch", 0 };
  register int i;
  register char *p;
  register char *ap;
  char *end;
  int instring;
  char **new_argv = 0;

  if (restp != ((void *) 0) )
    *restp = ((void *) 0) ;

   
  while ((__ctype_b[(*line)] & (unsigned short int)  _ISblank)  )
    ++line;
  if (*line == '\0')
    return 0;

   
  if (shell == 0)
    shell = default_shell;
  else if (strcmp (shell, default_shell))
    goto slow;

  if (ifs != 0)
    for (ap = ifs; *ap != '\0'; ++ap)
      if (*ap != ' ' && *ap != '\t' && *ap != '\n')
	goto slow;

  i = strlen (line) + 1;

   
  new_argv = (char **) xmalloc (i * sizeof (char *));

   
  ap = new_argv[0] = (char *) xmalloc (i);
  end = ap + i;

   
  i = 0;
  instring = 0;
  for (p = line; *p != '\0'; ++p)
    {
      if (ap > end)
	abort ();

      if (instring)
	{
	   
	  if (*p == '\'')
	    instring = 0;
	  else
	    *ap++ = *p;
	}
      else if (strchr((sh_chars), ( *p))  != 0)
	 
	goto slow;
      else
	 
	switch (*p)
	  {
	  case '\\':
	     
	    if (p[1] == '\n')
	      {
		 

		p += 2;

		 



		if (*p == '\t')
		  strcpy (p, p + 1);

		if (ap != new_argv[i])
		   


		  goto end_of_arg;
		else
		  p = next_token (p) - 1;
	      }
	    else if (p[1] != '\0')
	       
	      *ap++ = *++p;
	    break;

	  case '\'':
	    instring = 1;
	    break;

	  case '\n':
	    if (restp != ((void *) 0) )
	      {
		 
		*restp = p;
		goto end_of_line;
	      }
	    else
	       
	      *ap++ = '\n';
	    break;

	  case ' ':
	  case '\t':
	  end_of_arg:
	     

	    *ap++ = '\0';
	    new_argv[++i] = ap;
	     


	    if (i == 1)
	      {
		register int j;
		for (j = 0; sh_cmds[j] != 0; ++j)
		  if (((sh_cmds[j]) == ( new_argv[0]) || (*(sh_cmds[j]) == *( new_argv[0]) && (*(sh_cmds[j]) == '\0' || !strcmp ((sh_cmds[j]) + 1, ( new_argv[0]) + 1)))) )
		    goto slow;
	      }

	     
	    p = next_token (p);
	     
	    --p;
	    break;

	  default:
	    *ap++ = *p;
	    break;
	  }
    }
 end_of_line:

  if (instring)
     
    goto slow;

   

  *ap = '\0';
  if (new_argv[i][0] != '\0')
    ++i;
  new_argv[i] = 0;

  if (new_argv[0] == 0)
     
    return 0;
  else
    return new_argv;

 slow:;
   

  if (new_argv != 0)
    {
       
      free (new_argv[0]);
      free (new_argv);
    }

  {
     



    
    unsigned int shell_len = strlen (shell);
    static char minus_c[] = " -c ";
    unsigned int line_len = strlen (line);
    
    char *new_line = (char *) __builtin_alloca (shell_len + (sizeof (minus_c) - 1)
				      + (line_len * 2) + 1) ;
    
    ap = new_line;
    memcpy (( ap), (shell), ( shell_len)) ;
    ap += shell_len;
    memcpy (( ap), (minus_c), ( sizeof (minus_c) - 1)) ;
    ap += sizeof (minus_c) - 1;
    for (p = line; *p != '\0'; ++p)
      {
	if (restp != ((void *) 0)  && *p == '\n')
	  {
	    *restp = p;
	    break;
	  }
	else if (*p == '\\' && p[1] == '\n')
	  {
	     


	    p += 2;

	     



	    if (*p == '\t')
	      strcpy (p, p + 1);

	    p = next_token (p);
	    --p;
	    *ap++ = '\\';
	    *ap++ = ' ';
	    continue;
	  }

	if (*p == '\\' || *p == '\''
	    || (__ctype_b[(*p)] & (unsigned short int)  _ISspace)  
	    || strchr((sh_chars), ( *p))  != 0)
	  *ap++ = '\\';
	*ap++ = *p;
      }
    *ap = '\0';
    
    new_argv = construct_command_argv_internal (new_line, (char **) ((void *) 0) ,
						(char *) 0, (char *) 0);
  }

  return new_argv;
}

 











char **
construct_command_argv (line, restp, file)
     char *line, **restp;
     struct file *file;
{
  char *shell = allocated_variable_expand_for_file ("$(SHELL)", file);
  char *ifs = allocated_variable_expand_for_file ("$(IFS)", file);
  char **argv;

  argv = construct_command_argv_internal (line, restp, shell, ifs);

  free (shell);
  free (ifs);

  return argv;
}

# 1442 "job.c"


# 1462 "job.c"


Newsgroups: gnu.gcc.bug