]> granicus.if.org Git - strace/blob - defs.h
2003-07-28 Daniel Jacobowitz <drow@mvista.com>
[strace] / defs.h
1 /*
2  * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. The name of the author may not be used to endorse or promote products
16  *    derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  *
29  *      $Id$
30  */
31
32 #ifdef linux
33 #include <features.h>
34 #endif
35
36 #ifdef _LARGEFILE64_SOURCE
37 /* This is the macro everything checks before using foo64 names.  */
38 # ifndef _LFS64_LARGEFILE
39 #  define _LFS64_LARGEFILE 1
40 # endif
41 #endif
42
43 #ifdef HAVE_CONFIG_H
44 #include "config.h"
45 #endif
46
47 /* configuration section */
48 #ifndef MAX_QUALS
49 #if defined(LINUX) && defined(MIPS)
50 #define MAX_QUALS       5000    /* maximum number of syscalls, signals, etc. */
51 #else
52 #define MAX_QUALS       2048    /* maximum number of syscalls, signals, etc. */
53 #endif
54 #endif
55 #ifndef DEFAULT_STRLEN
56 #define DEFAULT_STRLEN  32      /* default maximum # of bytes printed in
57                                   `printstr', change with `-s' switch */
58 #endif
59 #ifndef DEFAULT_ACOLUMN
60 #define DEFAULT_ACOLUMN 40      /* default alignment column for results */
61 #endif
62 #ifndef MAX_ARGS
63 #define MAX_ARGS        32      /* maximum number of args to a syscall */
64 #endif
65 #ifndef DEFAULT_SORTBY
66 #define DEFAULT_SORTBY "time"   /* default sorting method for call profiling */
67 #endif
68
69 #include <sys/types.h>
70 #include <unistd.h>
71 #include <stdlib.h>
72 #include <stdio.h>
73 #include <ctype.h>
74 #include <string.h>
75 #include <time.h>
76 #include <sys/time.h>
77 #include <errno.h>
78
79 #ifdef STDC_HEADERS
80 #include <stddef.h>
81 #endif /* STDC_HEADERS */
82
83 #ifdef HAVE_SIGINFO_T
84 #include <signal.h>
85 #endif
86
87 #if defined(LINUX)
88 #  if defined(SPARC)
89 #     define LINUXSPARC
90 #  endif
91 #  if defined(ALPHA)
92 #     define LINUX_64BIT
93 #  endif
94 #  if defined(X86_64)
95 #     define LINUX_X86_64
96 #  endif
97 #endif
98
99 #if defined(SVR4) || defined(FREEBSD)
100 #define USE_PROCFS
101 #else
102 #undef USE_PROCFS
103 #endif
104
105 #ifdef FREEBSD
106 #ifndef I386
107 #error "FreeBSD support is only for i386 arch right now."
108 #endif
109 #include <machine/psl.h>
110 #include <machine/reg.h>
111 #include <sys/syscall.h>
112 #endif
113
114 #ifdef USE_PROCFS
115 #include <sys/procfs.h>
116 #ifdef HAVE_MP_PROCFS
117 #include <sys/uio.h>
118 #endif
119 #ifdef FREEBSD
120 #include <sys/pioctl.h>
121 #endif /* FREEBSD */
122 #else /* !USE_PROCFS */
123 #if (defined(LINUXSPARC) || defined (LINUX_X86_64)) && defined(__GLIBC__)
124 #include <sys/ptrace.h>
125 #else
126 /* Work around awkward prototype in ptrace.h. */
127 #define ptrace xptrace
128 #include <sys/ptrace.h>
129 #undef ptrace
130 #ifdef POWERPC
131 #define __KERNEL__
132 #include <asm/ptrace.h>
133 #undef __KERNEL__
134 #endif
135 #ifdef __STDC__
136 #ifdef LINUX
137 extern long ptrace(int, int, char *, long);
138 #else /* !LINUX */
139 extern int ptrace(int, int, char *, int, ...);
140 #endif /* !LINUX */
141 #else /* !__STDC__ */
142 extern int ptrace();
143 #endif /* !__STDC__ */
144 #endif /* !LINUXSPARC */
145 #endif /* !SVR4 */
146
147 #ifdef LINUX
148 #if !defined(__GLIBC__)
149 #define PTRACE_PEEKUSER PTRACE_PEEKUSR
150 #define PTRACE_POKEUSER PTRACE_POKEUSR
151 #endif
152 #ifdef ALPHA
153 #  define REG_R0 0
154 #  define REG_A0 16
155 #  define REG_A3 19
156 #  define REG_FP 30
157 #  define REG_PC 64
158 #endif /* ALPHA */
159 #ifdef MIPS
160 #  define REG_V0 2
161 #  define REG_A0 4
162 #  define REG_A3 7
163 #  define REG_SP 29
164 #  define REG_EPC 64
165 #endif /* MIPS */
166 #ifdef HPPA
167 #  define PT_GR20 (20*4)
168 #  define PT_GR26 (26*4)
169 #  define PT_GR28 (28*4)
170 #  define PT_IAOQ0 (106*4)
171 #  define PT_IAOQ1 (107*4)
172 #endif /* HPPA */
173 #ifdef SH64
174    /* SH64 Linux - this code assumes the following kernel API for system calls:
175           PC           Offset 0
176           System Call  Offset 16 (actually, (syscall no.) | (0x1n << 16),
177                        where n = no. of parameters.
178           Other regs   Offset 24+
179
180           On entry:    R2-7 = parameters 1-6 (as many as necessary)
181           On return:   R9   = result. */
182
183    /* Offset for peeks of registers */
184 #  define REG_OFFSET         (24)
185 #  define REG_GENERAL(x)     (8*(x)+REG_OFFSET)
186 #  define REG_PC             (0*8)
187 #  define REG_SYSCALL        (2*8)
188 #endif /* SH64 */
189 #endif /* LINUX */
190
191 #define SUPPORTED_PERSONALITIES 1
192 #define DEFAULT_PERSONALITY 0
193
194 #ifdef LINUXSPARC
195 #include <linux/a.out.h>
196 #include <asm/psr.h>
197 #undef  SUPPORTED_PERSONALITIES
198 #define SUPPORTED_PERSONALITIES 2
199 #endif /* LINUXSPARC */
200
201 #ifdef X86_64
202 #undef SUPPORTED_PERSONALITIES
203 #define SUPPORTED_PERSONALITIES 2
204 #endif
205
206 #ifdef SVR4
207 #ifdef HAVE_MP_PROCFS
208 extern int mp_ioctl (int f, int c, void *a, int s);
209 #define IOCTL(f,c,a)    mp_ioctl (f, c, a, sizeof *a)
210 #define IOCTL_STATUS(t) \
211          pread (t->pfd_stat, &t->status, sizeof t->status, 0)
212 #define IOCTL_WSTOP(t)                                          \
213         (IOCTL (t->pfd, PCWSTOP, (char *)NULL) < 0 ? -1 :               \
214          IOCTL_STATUS (t))
215 #define PR_WHY          pr_lwp.pr_why
216 #define PR_WHAT         pr_lwp.pr_what
217 #define PR_REG          pr_lwp.pr_context.uc_mcontext.gregs
218 #define PR_FLAGS        pr_lwp.pr_flags
219 #define PR_SYSCALL      pr_lwp.pr_syscall
220 #define PR_INFO         pr_lwp.pr_info
221 #define PIOCSTIP        PCSTOP
222 #define PIOCSET         PCSET
223 #define PIOCRESET       PCRESET
224 #define PIOCSTRACE      PCSTRACE
225 #define PIOCSFAULT      PCSFAULT
226 #define PIOCWSTOP       PCWSTOP
227 #define PIOCSTOP        PCSTOP
228 #define PIOCSENTRY      PCSENTRY
229 #define PIOCSEXIT       PCSEXIT
230 #define PIOCRUN         PCRUN
231 #else
232 #define IOCTL           ioctl
233 #define IOCTL_STATUS(t) ioctl (t->pfd, PIOCSTATUS, &t->status)
234 #define IOCTL_WSTOP(t)  ioctl (t->pfd, PIOCWSTOP, &t->status)
235 #define PR_WHY          pr_why
236 #define PR_WHAT         pr_what
237 #define PR_REG          pr_reg
238 #define PR_FLAGS        pr_flags
239 #define PR_SYSCALL      pr_syscall
240 #define PR_INFO         pr_info
241 #endif
242 #endif
243 #ifdef FREEBSD
244 #define IOCTL           ioctl
245 #define IOCTL_STATUS(t) ioctl (t->pfd, PIOCSTATUS, &t->status)
246 #define IOCTL_WSTOP(t)  ioctl (t->pfd, PIOCWAIT, &t->status)
247 #define PIOCRUN         PIOCCONT
248 #define PIOCWSTOP       PIOCWAIT
249 #define PR_WHY          why
250 #define PR_WHAT         val
251 #define PR_FLAGS        state
252 /* from /usr/src/sys/miscfs/procfs/procfs_vnops.c,
253    status.state = 0 for running, 1 for stopped */
254 #define PR_ASLEEP       1
255 #define PR_SYSENTRY     S_SCE
256 #define PR_SYSEXIT      S_SCX
257 #define PR_SIGNALLED    S_SIG
258 #define PR_FAULTED      S_CORE
259 #endif
260
261 /* Trace Control Block */
262 struct tcb {
263         short flags;            /* See below for TCB_ values */
264         int pid;                /* Process Id of this entry */
265         long scno;              /* System call number */
266         int u_nargs;            /* System call arguments */
267         long u_arg[MAX_ARGS];   /* System call arguments */
268         int u_error;            /* Error code */
269         long u_rval;            /* (first) return value */
270 #ifdef HAVE_LONG_LONG
271         long long u_lrval;      /* long long return value */
272 #endif
273         FILE *outf;             /* Output file for this process */
274         const char *auxstr;     /* Auxiliary info from syscall (see RVAL_STR) */
275         struct timeval stime;   /* System time usage as of last process wait */
276         struct timeval dtime;   /* Delta for system time usage */
277         struct timeval etime;   /* Syscall entry time */
278                                 /* Support for tracing forked processes */
279         struct tcb *parent;     /* Parent of this process */
280         int nchildren;          /* # of traced children */
281         int waitpid;            /* pid(s) this process is waiting for */
282         int nzombies;           /* # of formerly traced children now dead */
283 #ifdef LINUX
284         int nclone_threads;     /* # of nchildren with CLONE_THREAD */
285         int nclone_detached;    /* # of nchildren with CLONE_DETACHED */
286         int nclone_waiting;     /* clone threads in wait4 (TCB_SUSPENDED) */
287 #endif
288                                 /* (1st arg of wait4()) */
289         long baddr;             /* `Breakpoint' address */
290         long inst[2];           /* Instructions on above */
291         int pfd;                /* proc file descriptor */
292 #ifdef SVR4
293 #ifdef HAVE_MP_PROCFS
294         int pfd_stat;
295         int pfd_as;
296         pstatus_t status;
297 #else
298         prstatus_t status;      /* procfs status structure */
299 #endif
300 #endif
301 #ifdef FREEBSD
302         struct procfs_status status;
303         int pfd_reg;
304         int pfd_status;
305 #endif
306 };
307
308 /* TCB flags */
309 #define TCB_STARTUP     00001   /* We have just begun ptracing this process */
310 #define TCB_INUSE       00002   /* This table entry is in use */
311 #define TCB_INSYSCALL   00004   /* A system call is in progress */
312 #define TCB_ATTACHED    00010   /* Process is not our own child */
313 #define TCB_EXITING     00020   /* As far as we know, this process is exiting */
314 #define TCB_SUSPENDED   00040   /* Process has done a wait(4), that can
315                                    not be allowed to complete just now */
316 #define TCB_BPTSET      00100   /* "Breakpoint" set after fork(2) */
317 #define TCB_SIGTRAPPED  00200   /* Process wanted to block SIGTRAP */
318 #define TCB_FOLLOWFORK  00400   /* Process should have forks followed */
319 #define TCB_REPRINT     01000   /* We should reprint this syscall on exit */
320 #ifdef LINUX
321 # if defined(ALPHA) || defined(SPARC) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM)
322 #  define TCB_WAITEXECVE 02000  /* ignore SIGTRAP after exceve */
323 # endif
324 # define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */
325 # define TCB_CLONE_THREAD  010000 /* CLONE_THREAD set in creating syscall */
326 # define TCB_GROUP_EXITING 020000 /* TCB_EXITING was exit_group, not _exit */
327 # include <sys/syscall.h>
328 # ifndef __NR_exit_group
329 # /* Hack: Most headers around are too old to have __NR_exit_group.  */
330 #  ifdef ALPHA
331 #   define __NR_exit_group 405
332 #  elif defined I386
333 #   define __NR_exit_group 252
334 #  elif defined IA64
335 #   define __NR_exit_group 1236
336 #  elif defined POWERPC
337 #   define __NR_exit_group 234
338 #  elif defined S390 || defined S390X
339 #   define __NR_exit_group 248
340 #  elif defined SPARC
341 #   define __NR_exit_group 188
342 #  endif /* ALPHA et al */
343 # endif /* !__NR_exit_group */
344 #endif /* LINUX */
345
346 /* qualifier flags */
347 #define QUAL_TRACE      0001    /* this system call should be traced */
348 #define QUAL_ABBREV     0002    /* abbreviate the structures of this syscall */
349 #define QUAL_VERBOSE    0004    /* decode the structures of this syscall */
350 #define QUAL_RAW        0010    /* print all args in hex for this syscall */
351 #define QUAL_SIGNAL     0020    /* report events with this signal */
352 #define QUAL_FAULT      0040    /* report events with this fault */
353 #define QUAL_READ       0100    /* dump data read on this file descriptor */
354 #define QUAL_WRITE      0200    /* dump data written to this file descriptor */
355
356 #define entering(tcp)   (!((tcp)->flags & TCB_INSYSCALL))
357 #define exiting(tcp)    ((tcp)->flags & TCB_INSYSCALL)
358 #define syserror(tcp)   ((tcp)->u_error != 0)
359 #define verbose(tcp)    (qual_flags[(tcp)->scno] & QUAL_VERBOSE)
360 #define abbrev(tcp)     (qual_flags[(tcp)->scno] & QUAL_ABBREV)
361
362 struct xlat {
363         int val;
364         char *str;
365 };
366
367 /* Format of syscall return values */
368 #define RVAL_DECIMAL    000     /* decimal format */
369 #define RVAL_HEX        001     /* hex format */
370 #define RVAL_OCTAL      002     /* octal format */
371 #define RVAL_UDECIMAL   003     /* unsigned decimal format */
372 #define RVAL_LDECIMAL   004     /* long decimal format */
373 #define RVAL_LHEX       005     /* long hex format */
374 #define RVAL_LOCTAL     006     /* long octal format */
375 #define RVAL_LUDECIMAL  007     /* long unsigned decimal format */
376 #define RVAL_MASK       007     /* mask for these values */
377
378 #define RVAL_STR        010     /* Print `auxstr' field after return val */
379 #define RVAL_NONE       020     /* Print nothing */
380
381 #ifndef offsetof
382 #define offsetof(type, member)  (((char *) &(((type *) NULL)->member)) - \
383                                  ((char *) (type *) NULL))
384 #endif /* !offsetof */
385
386 /* get offset of member within a user struct */
387 #define uoff(member)    offsetof(struct user, member)
388
389 #define TRACE_FILE      001     /* Trace file-related syscalls. */
390 #define TRACE_IPC       002     /* Trace IPC-related syscalls. */
391 #define TRACE_NETWORK   004     /* Trace network-related syscalls. */
392 #define TRACE_PROCESS   010     /* Trace process-related syscalls. */
393 #define TRACE_SIGNAL    020     /* Trace signal-related syscalls. */
394
395 extern struct tcb **tcbtab;
396 extern int qual_flags[];
397 extern int debug, followfork, followvfork;
398 extern int rflag, tflag, dtime, cflag, xflag, qflag;
399 extern int acolumn;
400 extern char *outfname;
401 extern unsigned int nprocs, tcbtabsize;
402 extern int max_strlen;
403 extern struct tcb *tcp_last;
404
405 #ifdef __STDC__
406 #define P(args) args
407 #else
408 #define P(args) ()
409 #endif
410
411 extern int set_personality P((int personality));
412 extern char *xlookup P((struct xlat *, int));
413 extern struct tcb *alloctcb P((int));
414 extern struct tcb *pid2tcb P((int));
415 extern void droptcb P((struct tcb *));
416
417 extern void set_sortby P((char *));
418 extern void set_overhead P((int));
419 extern void qualify P((char *));
420 extern void newoutf P((struct tcb *));
421 extern int get_scno P((struct tcb *));
422 extern int trace_syscall P((struct tcb *));
423 extern void printxval P((struct xlat *, int, char *));
424 extern int printargs P((struct tcb *));
425 extern int addflags P((struct xlat *, int));
426 extern int printflags P((struct xlat *, int));
427 extern int umoven P((struct tcb *, long, int, char *));
428 extern int umovestr P((struct tcb *, long, int, char *));
429 extern int upeek P((int, long, long *));
430 extern void dumpiov P((struct tcb *, int, long));
431 extern void dumpstr P((struct tcb *, long, int));
432 extern void string_quote P((char *str));
433 extern void printstr P((struct tcb *, long, int));
434 extern void printnum P((struct tcb *, long, char *));
435 extern void printpath P((struct tcb *, long));
436 extern void printpathn P((struct tcb *, long, int));
437 extern void printtv P((struct tcb *, long));
438 #ifdef HAVE_SIGINFO_T
439 extern void printsiginfo P((siginfo_t *, int));
440 #endif
441 extern void printsock P((struct tcb *, long, int));
442 extern void print_sock_optmgmt P((struct tcb *, long, int));
443 extern void printrusage P((struct tcb *, long));
444 extern int clearbpt P((struct tcb *));
445 extern int setbpt P((struct tcb *));
446 extern int sigishandled P((struct tcb *, int));
447 extern void printcall P((struct tcb *));
448 extern char *signame P((int));
449 extern void printsignal P((int));
450 extern void printleader P((struct tcb *));
451 extern void printtrailer P((struct tcb *));
452 extern void tabto P((int));
453 extern void call_summary P((FILE *));
454 extern void fake_execve P((struct tcb *, char *, char *[], char *[]));
455 extern void printtv32 P((struct tcb*, long));
456 extern void tprint_iov P((struct tcb *, int, long));
457
458 #ifdef LINUX
459 extern int internal_clone P((struct tcb *));
460 #endif
461 extern int internal_fork P((struct tcb *));
462 extern int internal_exec P((struct tcb *));
463 extern int internal_wait P((struct tcb *));
464 extern int internal_exit P((struct tcb *));
465
466 extern char *ioctl_lookup P((long));
467 extern int ioctl_decode P((struct tcb *, long, long));
468 extern int term_ioctl P((struct tcb *, long, long));
469 extern int sock_ioctl P((struct tcb *, long, long));
470 extern int proc_ioctl P((struct tcb *, int, int));
471 extern int stream_ioctl P((struct tcb *, int, int));
472
473 extern void tv_tv P((struct timeval *, int, int));
474 extern int tv_nz P((struct timeval *));
475 extern int tv_cmp P((struct timeval *, struct timeval *));
476 extern double tv_float P((struct timeval *));
477 extern void tv_add P((struct timeval *, struct timeval *, struct timeval *));
478 extern void tv_sub P((struct timeval *, struct timeval *, struct timeval *));
479 extern void tv_mul P((struct timeval *, struct timeval *, int));
480 extern void tv_div P((struct timeval *, struct timeval *, int));
481
482 #ifdef SUNOS4
483 extern int fixvfork P((struct tcb *));
484 #endif
485 #if !(defined(LINUX) && !defined(SPARC))
486 extern long getrval2 P((struct tcb *));
487 #endif
488 #ifdef USE_PROCFS
489 extern int proc_open P((struct tcb *tcp, int attaching));
490 #endif
491
492 #define umove(pid, addr, objp)  \
493         umoven((pid), (addr), sizeof *(objp), (char *) (objp))
494
495 #ifdef __STDC__
496 #ifdef __GNUC__
497 extern void tprintf(const char *fmt, ...)
498         __attribute__ ((format (printf, 1, 2)));
499 #else
500 extern void tprintf(const char *fmt, ...);
501 #endif
502 #else
503 extern void tprintf();
504 #endif
505
506 #ifndef HAVE_STRERROR
507 const char *strerror P((int));
508 #endif
509 #ifndef HAVE_STRSIGNAL
510 const char *strsignal P((int));
511 #endif
512
513 extern int current_personality;
514
515 struct sysent {
516         int     nargs;
517         int     sys_flags;
518         int     (*sys_func)();
519         char    *sys_name;
520 };
521
522 extern struct sysent *sysent;
523 extern int nsyscalls;
524
525 extern char **errnoent;
526 extern int nerrnos;
527
528 struct ioctlent {
529         char *doth;
530         char *symbol;
531         unsigned long code;
532 };
533
534 extern struct ioctlent *ioctlent;
535 extern int nioctlent;
536
537 extern char **signalent;
538 extern int nsignals;
539
540 extern struct ioctlent *ioctlent;
541 extern int nioctlents;
542 extern char **signalent;
543 extern int nsignals;
544
545 extern struct ioctlent ioctlent0[];
546 extern int nioctlents0;
547 extern char *signalent0[];
548 extern int nsignals0;
549
550 #if SUPPORTED_PERSONALITIES >= 2
551 extern struct ioctlent ioctlent1[];
552 extern int nioctlents1;
553 extern char *signalent1[];
554 extern int nsignals1;
555 #endif /* SUPPORTED_PERSONALITIES >= 2 */
556
557 #if SUPPORTED_PERSONALITIES >= 3
558 extern struct ioctlent ioctlent2[];
559 extern int nioctlents2;
560 extern char *signalent2[];
561 extern int nsignals2;
562 #endif /* SUPPORTED_PERSONALITIES >= 3 */
563
564 #if defined(FREEBSD) || (defined(LINUX) \
565                          && defined(POWERPC) && !defined(__powerpc64__)) \
566   || (defined (LINUX) && defined (MIPS) && !defined(__mips64))
567 /* ARRGH!  off_t args are aligned on 64 bit boundaries! */
568 #define ALIGN64(tcp,arg)                                                \
569 do {                                                                    \
570         if (arg % 2)                                                    \
571             memmove (&tcp->u_arg[arg], &tcp->u_arg[arg + 1],            \
572                      (tcp->u_nargs - arg - 1) * sizeof tcp->u_arg[0]);  \
573 } while (0)
574 #else
575 #define ALIGN64(tcp,arg) do { } while (0)
576 #endif
577
578 #if HAVE_LONG_LONG
579
580 /* _l refers to the lower numbered u_arg,
581  * _h refers to the higher numbered u_arg
582  */
583
584 #if HAVE_LITTLE_ENDIAN_LONG_LONG
585 #define LONG_LONG(_l,_h) \
586     ((long long)((unsigned long long)(unsigned)(_l) | ((unsigned long long)(_h)<<32)))
587 #else
588 #define LONG_LONG(_l,_h) \
589     ((long long)((unsigned long long)(unsigned)(_h) | ((unsigned long long)(_l)<<32)))
590 #endif
591 #endif
592
593 #ifdef IA64
594 extern long ia32;
595 #endif
596
597 extern int not_failing_only;