Browse Source

2002-12-22 Roland McGrath <roland@redhat.com>

	Update to Autoconf 2.57, and Automakify with version 1.7.
	* Makefile.am: New file.
	* Makefile.in: File removed.
	* configure.in: Moved to ...
	* configure.ac: ... here.  Update for Autoconf 2.5x and Automake.
	* aclocal.m4: Moved to ...
	* acinclude.m4: ... here.  Update for Autoconf 2.5x.
	* AUTHORS: New file, makes automake happy.
	* autogen.sh: File removed.
	* README-CVS: Update to recommend autoreconf instead.
	* file.c: HAVE_ST_* -> HAVE_STRUCT_STAT_ST_*.
	* net.c: HAVE_SIN6_SCOPE_ID -> HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID,
	HAVE_MSG_CONTROL -> HAVE_STRUCT_MSGHDR_MSG_CONTROL.
	* strace.c: *_DECLARED -> HAVE_DECL_*
	* stream.c: HAVE_* -> HAVE_STRUCT_*
Roland McGrath 17 years ago
parent
commit
6d2b34971b
9 changed files with 552 additions and 53 deletions
  1. 1
    0
      AUTHORS
  2. 23
    0
      Makefile.am
  3. 3
    7
      README-CVS
  4. 281
    0
      acinclude.m4
  5. 198
    0
      configure.ac
  6. 24
    24
      file.c
  7. 15
    15
      net.c
  8. 4
    4
      strace.c
  9. 3
    3
      stream.c

+ 1
- 0
AUTHORS View File

@@ -0,0 +1 @@
1
+See the file CREDITS.  Automake likes us to have this file called AUTHORS.

+ 23
- 0
Makefile.am View File

@@ -0,0 +1,23 @@
1
+# Automake input for strace.
2
+
3
+bin_PROGRAMS = strace
4
+man_MANS = strace.1
5
+
6
+# OS is one of `linux', `sunos4', `svr4', or `freebsd'.
7
+OS		= @opsys@
8
+# ARCH is `i386', `m68k', `sparc', etc.
9
+ARCH		= @arch@
10
+# OSARCH is OS/ARCH if a makefile exists there, otherwise just OS.
11
+OSARCH		= @osarch@
12
+
13
+INCLUDES = -I$(OS)/$(ARCH) -I$(srcdir)/$(OS)/$(ARCH) -I$(OS) -I$(srcdir)/$(OS)
14
+
15
+SUBDIRS = $(OSARCH)
16
+DIST_SUBDIRS = test freebsd/i386 sunos4 svr4 linux
17
+
18
+strace_SOURCES = strace.c version.c syscall.c util.c desc.c file.c ipc.c \
19
+		 io.c ioctl.c mem.c net.c process.c bjm.c \
20
+		 resource.c signal.c sock.c system.c term.c time.c \
21
+		 proc.c stream.c
22
+
23
+EXTRA_DIST = $(man_MANS) errnoent.sh signalent.sh syscallent.sh ioctlsort.c

+ 3
- 7
README-CVS View File

@@ -1,9 +1,5 @@
1 1
 
2 2
 If you use the CVS version of strace there will be some files missing
3
-that you need to build strace. These files are generated by tools from
4
-the GNU autoconf package.
5
-
6
-In order to generate the missing package you can run the autogen.sh script.
7
-For some architectures (powerpc, (ultra)sparc) you need a recent version
8
-of autoconf, otherwise it might fail to recognize your system.
9
-
3
+that you need to build strace.  These files are generated by tools from
4
+the GNU Autoconf and Automake packages.  You need recent versions, which
5
+provide the `autoreconf -i' command that will do everything you need.

+ 281
- 0
acinclude.m4 View File

@@ -0,0 +1,281 @@
1
+dnl
2
+dnl This file contains macros used in configure.ac.
3
+dnl automake uses this file to generate aclocal.m4, which is used by autoconf.
4
+dnl
5
+
6
+dnl ### A macro to find the include directory, useful for cross-compiling.
7
+AC_DEFUN(AC_INCLUDEDIR,
8
+[AC_REQUIRE([AC_PROG_AWK])dnl
9
+AC_SUBST(includedir)
10
+AC_MSG_CHECKING(for primary include directory)
11
+includedir=/usr/include
12
+if test -n "$GCC"
13
+then
14
+	>conftest.c
15
+	new_includedir=`
16
+		$CC -v -E conftest.c 2>&1 | $AWK '
17
+			/^End of search list/ { print last; exit }
18
+			{ last = [$]1 }
19
+		'
20
+	`
21
+	rm -f conftest.c
22
+	if test -n "$new_includedir" && test -d "$new_includedir"
23
+	then
24
+		includedir=$new_includedir
25
+	fi
26
+fi
27
+AC_MSG_RESULT($includedir)
28
+])
29
+
30
+dnl ### A macro to set gcc warning flags.
31
+define(AC_WARNFLAGS,
32
+[AC_SUBST(WARNFLAGS)
33
+if test -z "$WARNFLAGS"
34
+then
35
+	if test -n "$GCC"
36
+	then
37
+		# If we're using gcc we want warning flags.
38
+		WARNFLAGS=-Wall
39
+	fi
40
+fi
41
+])
42
+
43
+dnl ### A macro to determine if we have a "MP" type procfs
44
+AC_DEFUN(AC_MP_PROCFS,
45
+[AC_MSG_CHECKING(for MP procfs)
46
+AC_CACHE_VAL(ac_cv_mp_procfs,
47
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
48
+#include <stdio.h>
49
+#include <signal.h>
50
+#include <sys/procfs.h>
51
+
52
+main()
53
+{
54
+	int pid;
55
+	char proc[32];
56
+	FILE *ctl;
57
+	FILE *status;
58
+	int cmd;
59
+	struct pstatus pstatus;
60
+
61
+	if ((pid = fork()) == 0) {
62
+		pause();
63
+		exit(0);
64
+	}
65
+	sprintf(proc, "/proc/%d/ctl", pid);
66
+	if ((ctl = fopen(proc, "w")) == NULL)
67
+		goto fail;
68
+	sprintf(proc, "/proc/%d/status", pid);
69
+	if ((status = fopen (proc, "r")) == NULL)
70
+		goto fail;
71
+	cmd = PCSTOP;
72
+	if (write (fileno (ctl), &cmd, sizeof cmd) < 0)
73
+		goto fail;
74
+	if (read (fileno (status), &pstatus, sizeof pstatus) < 0)
75
+		goto fail;
76
+	kill(pid, SIGKILL);
77
+	exit(0);
78
+fail:
79
+	kill(pid, SIGKILL);
80
+	exit(1);
81
+}
82
+]])],[ac_cv_mp_procfs=yes],[ac_cv_mp_procfs=no],[
83
+# Guess or punt.
84
+case "$host_os" in
85
+svr4.2*|svr5*)
86
+	ac_cv_mp_procfs=yes
87
+	;;
88
+*)
89
+	ac_cv_mp_procfs=no
90
+	;;
91
+esac
92
+])])
93
+AC_MSG_RESULT($ac_cv_mp_procfs)
94
+if test "$ac_cv_mp_procfs" = yes
95
+then
96
+	AC_DEFINE([HAVE_MP_PROCFS], 1,
97
+[Define if you have a SVR4 MP type procfs.
98
+I.E. /dev/xxx/ctl, /dev/xxx/status.
99
+Also implies that you have the pr_lwp member in prstatus.])
100
+fi
101
+])
102
+
103
+dnl ### A macro to determine if procfs is pollable.
104
+AC_DEFUN(AC_POLLABLE_PROCFS,
105
+[AC_MSG_CHECKING(for pollable procfs)
106
+AC_CACHE_VAL(ac_cv_pollable_procfs,
107
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
108
+#include <stdio.h>
109
+#include <signal.h>
110
+#include <sys/procfs.h>
111
+#include <sys/stropts.h>
112
+#include <poll.h>
113
+
114
+#ifdef HAVE_MP_PROCFS
115
+#define PIOCSTOP	PCSTOP
116
+#define POLLWANT	POLLWRNORM
117
+#define PROC		"/proc/%d/ctl"
118
+#define PROC_MODE	"w"
119
+int IOCTL (int fd, int cmd, int arg) {
120
+	return write (fd, &cmd, sizeof cmd);
121
+}
122
+#else
123
+#define POLLWANT	POLLPRI
124
+#define	PROC		"/proc/%d"
125
+#define PROC_MODE	"r+"
126
+#define IOCTL		ioctl
127
+#endif
128
+
129
+main()
130
+{
131
+	int pid;
132
+	char proc[32];
133
+	FILE *pfp;
134
+	struct pollfd pfd;
135
+
136
+	if ((pid = fork()) == 0) {
137
+		pause();
138
+		exit(0);
139
+	}
140
+	sprintf(proc, PROC, pid);
141
+	if ((pfp = fopen(proc, PROC_MODE)) == NULL)
142
+		goto fail;
143
+	if (IOCTL(fileno(pfp), PIOCSTOP, NULL) < 0)
144
+		goto fail;
145
+	pfd.fd = fileno(pfp);
146
+	pfd.events = POLLWANT;
147
+	if (poll(&pfd, 1, 0) < 0)
148
+		goto fail;
149
+	if (!(pfd.revents & POLLWANT))
150
+		goto fail;
151
+	kill(pid, SIGKILL);
152
+	exit(0);
153
+fail:
154
+	kill(pid, SIGKILL);
155
+	exit(1);
156
+}
157
+]])],[ac_cv_pollable_procfs=yes],[ac_cv_pollable_procfs=no],[
158
+# Guess or punt.
159
+case "$host_os" in
160
+solaris2*|irix5*|svr4.2uw*|svr5*)
161
+	ac_cv_pollable_procfs=yes
162
+	;;
163
+*)
164
+	ac_cv_pollable_procfs=no
165
+	;;
166
+esac
167
+])])
168
+AC_MSG_RESULT($ac_cv_pollable_procfs)
169
+if test "$ac_cv_pollable_procfs" = yes
170
+then
171
+	AC_DEFINE([HAVE_POLLABLE_PROCFS], 1,
172
+[Define if you have SVR4 and the poll system call works on /proc files.])
173
+fi
174
+])
175
+
176
+dnl ### A macro to determine if the prstatus structure has a pr_syscall member.
177
+AC_DEFUN(AC_STRUCT_PR_SYSCALL,
178
+[AC_MSG_CHECKING(for pr_syscall in struct prstatus)
179
+AC_CACHE_VAL(ac_cv_struct_pr_syscall,
180
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/procfs.h>]], [[#ifdef HAVE_MP_PROCFS
181
+pstatus_t s;
182
+s.pr_lwp.pr_syscall
183
+#else
184
+prstatus_t s;
185
+s.pr_syscall
186
+#endif]])],[ac_cv_struct_pr_syscall=yes],[ac_cv_struct_pr_syscall=no])])
187
+AC_MSG_RESULT($ac_cv_struct_pr_syscall)
188
+if test "$ac_cv_struct_pr_syscall" = yes
189
+then
190
+	AC_DEFINE([HAVE_PR_SYSCALL], 1,
191
+[Define if the prstatus structure in sys/procfs.h has a pr_syscall member.])
192
+fi
193
+])
194
+
195
+dnl ### A macro to determine whether stat64 is defined.
196
+AC_DEFUN(AC_STAT64,
197
+[AC_MSG_CHECKING(for stat64 in (asm|sys)/stat.h)
198
+AC_CACHE_VAL(ac_cv_type_stat64,
199
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
200
+#include <linux/types.h>
201
+#include <asm/stat.h>
202
+#else
203
+#include <sys/stat.h>
204
+#endif]], [[struct stat64 st;]])],[ac_cv_type_stat64=yes],[ac_cv_type_stat64=no])])
205
+AC_MSG_RESULT($ac_cv_type_stat64)
206
+if test "$ac_cv_type_stat64" = yes
207
+then
208
+	AC_DEFINE([HAVE_STAT64], 1,
209
+[Define if stat64 is available in asm/stat.h.])
210
+fi
211
+])
212
+
213
+dnl ### A macro to determine if off_t is a long long
214
+AC_DEFUN(AC_OFF_T_IS_LONG_LONG,
215
+[AC_MSG_CHECKING(for long long off_t)
216
+AC_CACHE_VAL(ac_cv_have_long_long_off_t,
217
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
218
+main () {
219
+	if (sizeof (off_t) == sizeof (long long) &&
220
+	    sizeof (off_t) > sizeof (long))
221
+	    return 0;
222
+	return 1;
223
+}
224
+]])],[ac_cv_have_long_long_off_t=yes],[ac_cv_have_long_long_off_t=no],[# Should try to guess here
225
+ac_cv_have_long_long_off_t=no
226
+])])
227
+AC_MSG_RESULT($ac_cv_have_long_long_off_t)
228
+if test "$ac_cv_have_long_long_off_t" = yes
229
+then
230
+	AC_DEFINE([HAVE_LONG_LONG_OFF_T], 1, [Define if off_t is a long long.])
231
+fi
232
+])
233
+
234
+dnl ### A macro to determine if rlim_t is a long long
235
+AC_DEFUN(AC_RLIM_T_IS_LONG_LONG,
236
+[AC_MSG_CHECKING(for long long rlim_t)
237
+AC_CACHE_VAL(ac_cv_have_long_long_rlim_t,
238
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
239
+#include <sys/time.h>
240
+#include <sys/resource.h>
241
+main () {
242
+	if (sizeof (rlim_t) == sizeof (long long) &&
243
+	    sizeof (rlim_t) > sizeof (long))
244
+	    return 0;
245
+	return 1;
246
+}
247
+]])],[ac_cv_have_long_long_rlim_t=yes],[ac_cv_have_long_long_rlim_t=no],[# Should try to guess here
248
+ac_cv_have_long_long_rlim_t=no
249
+])])
250
+AC_MSG_RESULT($ac_cv_have_long_long_rlim_t)
251
+if test "$ac_cv_have_long_long_rlim_t" = yes
252
+then
253
+	AC_DEFINE([HAVE_LONG_LONG_RLIM_T], 1, [Define if rlim_t is a long long.])
254
+fi
255
+])
256
+
257
+dnl ### A macro to determine endianness of long long
258
+AC_DEFUN(AC_LITTLE_ENDIAN_LONG_LONG,
259
+[AC_MSG_CHECKING(for little endian long long)
260
+AC_CACHE_VAL(ac_cv_have_little_endian_long_long,
261
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[
262
+int main () {
263
+	union {
264
+		long long ll;
265
+		long l [2];
266
+	} u;
267
+	u.ll = 0x12345678;
268
+	if (u.l[0] == 0x12345678)
269
+		return 0;
270
+	return 1;
271
+}
272
+]])],[ac_cv_have_little_endian_long_long=yes],[ac_cv_have_little_endian_long_long=no],[# Should try to guess here
273
+ac_cv_have_little_endian_long_long=no
274
+])])
275
+AC_MSG_RESULT($ac_cv_have_little_endian_long_long)
276
+if test "$ac_cv_have_little_endian_long_long" = yes
277
+then
278
+	AC_DEFINE([HAVE_LITTLE_ENDIAN_LONG_LONG], 1,
279
+[Define if long long is little-endian.])
280
+fi
281
+])

+ 198
- 0
configure.ac View File

@@ -0,0 +1,198 @@
1
+dnl Process this file with autoconf to create configure.  Use autoreconf.
2
+AC_PREREQ(2.57)
3
+AC_INIT([strace],[4.4.90])
4
+AC_CONFIG_SRCDIR([strace.c])
5
+AM_CONFIG_HEADER([config.h])
6
+AM_INIT_AUTOMAKE([foreign check-news dist-bzip2])
7
+AM_MAINTAINER_MODE
8
+AC_CANONICAL_HOST
9
+
10
+AC_MSG_CHECKING([for supported operating system])
11
+case "$host_os" in
12
+linux*)
13
+	opsys=linux
14
+	AC_DEFINE([LINUX], 1, [Define for the Linux operating system.])
15
+	;;
16
+sunos4*)
17
+	opsys=sunos4
18
+	AC_DEFINE([SUNOS4], 1, [Define for the SunOS 4.x operating system.])
19
+	;;
20
+solaris2* | sysv[[45]]* | irix[[56]]*)
21
+	opsys=svr4
22
+	AC_DEFINE([SVR4], 1, [Define for the System V release 4 operating
23
+system or a derivative like Solaris 2.x or Irix 5.x.])
24
+	case "$host_os" in
25
+	sysv4.2uw*)
26
+		AC_DEFINE(UNIXWARE, 2, [Define for UnixWare systems.])
27
+		;;
28
+	sysv5*)
29
+		AC_DEFINE(UNIXWARE, 7, [Define for UnixWare systems.])
30
+		;;
31
+	esac
32
+	;;
33
+freebsd*)
34
+	opsys=freebsd
35
+	AC_DEFINE([FREEBSD], 1, [Define for the FreeBSD operating system.])
36
+	;;
37
+*)
38
+	AC_MSG_RESULT([NO!])
39
+	AC_MSG_ERROR([operating system $host_os is not supported by strace])
40
+	;;
41
+esac
42
+AC_MSG_RESULT($opsys)
43
+
44
+AC_MSG_CHECKING([for supported architecture])
45
+case "$host_cpu" in
46
+i[[3456]]86|pentium)
47
+	arch=i386
48
+	AC_DEFINE([I386], 1, [Define for the i386 architecture.])
49
+	;;
50
+ia64)
51
+	arch=ia64
52
+	AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
53
+	;;
54
+m68k)
55
+	arch=m68k
56
+	AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
57
+	;;
58
+sparc*)
59
+	arch=sparc
60
+	AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
61
+	;;
62
+mips*)
63
+	arch=mips
64
+	AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
65
+	;;
66
+alpha*)
67
+	arch=alpha
68
+	AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
69
+	;;
70
+ppc|powerpc)
71
+	arch=powerpc
72
+	AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
73
+	;;
74
+arm*)
75
+	arch=arm
76
+	AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
77
+	;;
78
+s390)
79
+	arch=s390
80
+	AC_DEFINE([S390], 1, [Define for the S390 architecture.])
81
+	;;
82
+s390x)
83
+	arch=s390x
84
+	AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
85
+	;;
86
+hppa*|parisc*)
87
+	arch=hppa
88
+	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
89
+	;;
90
+sh)
91
+	arch=sh
92
+	AC_DEFINE([SH], 1, [Define for the SH architecture.])
93
+	;;
94
+x86?64*)
95
+	arch=x86_64
96
+	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
97
+	;;
98
+*)
99
+	AC_MSG_RESULT([NO!])
100
+	AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
101
+	;;
102
+esac
103
+AC_MSG_RESULT($arch)
104
+
105
+osarch="$opsys"
106
+if test -r "$srcdir/$opsys/$arch/Makefile.in"; then
107
+	osarch="$opsys/$arch"
108
+fi
109
+
110
+AC_SUBST(opsys)
111
+AC_SUBST(arch)
112
+AC_SUBST(osarch)
113
+
114
+CFLAGS="-D_GNU_SOURCE $CFLAGS"
115
+AC_PROG_CC
116
+AC_INCLUDEDIR
117
+
118
+if test "x$opsys" = "xsunos4" && test "x$arch" = "xsparc"
119
+then
120
+	AC_MSG_CHECKING(for valid machine include directory)
121
+	if test -d "$includedir/sun4"
122
+	then
123
+		rm -f machine
124
+		ln -s $includedir/sun4 machine
125
+		AC_MSG_RESULT(yes)
126
+		AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE, 1, [
127
+Define if you are have a SPARC with SUNOS4 and your want a version
128
+of strace that will work on sun4, sun4c and sun4m kernel architectures.
129
+Only useful if you have a symbolic link from machine to /usr/include/sun4
130
+in the compilation directory.])
131
+	else
132
+		AC_MSG_RESULT(no)
133
+	fi
134
+fi
135
+
136
+AC_WARNFLAGS
137
+if test "x$opsys" = "xsunos4"
138
+then
139
+	if test -n "$GCC"
140
+	then
141
+		# SunOS 4.x header files don't declare int functions.
142
+		WARNFLAGS="$WARNFLAGS -Wno-implicit"
143
+	fi
144
+fi
145
+
146
+AC_PROG_CPP
147
+AC_PROG_GCC_TRADITIONAL
148
+AC_PROG_INSTALL
149
+AC_C_CONST
150
+AC_HEADER_STDC
151
+AC_HEADER_DIRENT
152
+AC_HEADER_STAT
153
+AC_CHECK_MEMBERS([struct stat.st_blksize,
154
+	          struct stat.st_blocks,
155
+		  struct stat.st_aclcnt,
156
+		  struct stat.st_flags,
157
+		  struct stat.st_fstype,
158
+		  struct stat.st_gen,
159
+		  struct stat.st_level,
160
+		  struct stat.st_rdev])
161
+AC_STAT64
162
+
163
+AC_TYPE_SIGNAL
164
+AC_TYPE_UID_T
165
+AC_TYPE_MODE_T
166
+AC_TYPE_GETGROUPS
167
+AC_HEADER_MAJOR
168
+AC_CHECK_TYPES(sig_atomic_t siginfo_t,,, [#include <signal.h>])
169
+AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, [#include <netinet/in.h])
170
+AC_CHECK_TYPES([long long])
171
+AC_LITTLE_ENDIAN_LONG_LONG
172
+AC_OFF_T_IS_LONG_LONG
173
+AC_RLIM_T_IS_LONG_LONG
174
+AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
175
+AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
176
+
177
+if test x$opsys != xlinux; then
178
+AC_CHECK_LIB(nsl, main)
179
+fi
180
+
181
+AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl prctl sendmsg inet_ntop if_indextoname)
182
+AC_CHECK_HEADERS([sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h sys/uio.h sys/aio.h  poll.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h sys/nscsys.h], [], [])
183
+AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
184
+                 [], [], [#include <linux/socket.h>])
185
+
186
+AC_MP_PROCFS
187
+AC_POLLABLE_PROCFS
188
+
189
+AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
190
+AC_STRUCT_PR_SYSCALL
191
+
192
+AC_CHECK_DECLS([sys_errlist])
193
+AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
194
+
195
+AC_PATH_PROG([PERL], [perl])
196
+
197
+AC_CONFIG_FILES([Makefile $osarch/Makefile])
198
+AC_OUTPUT

+ 24
- 24
file.c View File

@@ -725,26 +725,26 @@ struct stat *statbuf;
725 725
 		    (unsigned long) statbuf->st_nlink,
726 726
 		    (unsigned long) statbuf->st_uid,
727 727
 		    (unsigned long) statbuf->st_gid);
728
-#ifdef HAVE_ST_BLKSIZE
728
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
729 729
 	    tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
730
-#endif /* HAVE_ST_BLKSIZE */
731
-#ifdef HAVE_ST_BLOCKS
730
+#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
731
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
732 732
 	    tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
733
-#endif /* HAVE_ST_BLOCKS */
733
+#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
734 734
     }
735 735
     else
736 736
 	    tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
737 737
     switch (statbuf->st_mode & S_IFMT) {
738 738
     case S_IFCHR: case S_IFBLK:
739
-#ifdef HAVE_ST_RDEV
739
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
740 740
 	    tprintf("st_rdev=makedev(%lu, %lu), ",
741 741
 		    (unsigned long) major(statbuf->st_rdev),
742 742
 		    (unsigned long) minor(statbuf->st_rdev));
743
-#else /* !HAVE_ST_RDEV */
743
+#else /* !HAVE_STRUCT_STAT_ST_RDEV */
744 744
 	    tprintf("st_size=makedev(%lu, %lu), ",
745 745
 		    (unsigned long) major(statbuf->st_size),
746 746
 		    (unsigned long) minor(statbuf->st_size));
747
-#endif /* !HAVE_ST_RDEV */
747
+#endif /* !HAVE_STRUCT_STAT_ST_RDEV */
748 748
 	    break;
749 749
     default:
750 750
 	    tprintf("st_size=%lu, ", statbuf->st_size);
@@ -754,24 +754,24 @@ struct stat *statbuf;
754 754
 	    tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
755 755
 	    tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
756 756
 	    tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
757
-#if HAVE_ST_FLAGS
757
+#if HAVE_STRUCT_STAT_ST_FLAGS
758 758
 		tprintf(", st_flags=");
759 759
 		if (statbuf->st_flags) {
760 760
 			printflags(fileflags, statbuf->st_flags);
761 761
 		} else
762 762
 			tprintf("0");
763 763
 #endif
764
-#if HAVE_ST_ACLCNT
764
+#if HAVE_STRUCT_STAT_ST_ACLCNT
765 765
 		tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
766 766
 #endif
767
-#if HAVE_ST_LEVEL
767
+#if HAVE_STRUCT_STAT_ST_LEVEL
768 768
 		tprintf(", st_level=%ld", statbuf->st_level);
769 769
 #endif
770
-#if HAVE_ST_FSTYPE
770
+#if HAVE_STRUCT_STAT_ST_FSTYPE
771 771
 		tprintf(", st_fstype=%.*s",
772 772
 			(int) sizeof statbuf->st_fstype, statbuf->st_fstype);
773 773
 #endif
774
-#if HAVE_ST_GEN
774
+#if HAVE_STRUCT_STAT_ST_GEN
775 775
 		tprintf(", st_gen=%u", statbuf->st_gen);
776 776
 #endif
777 777
 		tprintf("}");
@@ -858,27 +858,27 @@ long addr;
858 858
 			(unsigned long) statbuf.st_nlink,
859 859
 			(unsigned long) statbuf.st_uid,
860 860
 			(unsigned long) statbuf.st_gid);
861
-#ifdef HAVE_ST_BLKSIZE
861
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
862 862
 		tprintf("st_blksize=%lu, ",
863 863
 			(unsigned long) statbuf.st_blksize);
864
-#endif /* HAVE_ST_BLKSIZE */
865
-#ifdef HAVE_ST_BLOCKS
864
+#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
865
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
866 866
 		tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
867
-#endif /* HAVE_ST_BLOCKS */
867
+#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
868 868
 	}
869 869
 	else
870 870
 		tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
871 871
 	switch (statbuf.st_mode & S_IFMT) {
872 872
 	case S_IFCHR: case S_IFBLK:
873
-#ifdef HAVE_ST_RDEV
873
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
874 874
 		tprintf("st_rdev=makedev(%lu, %lu), ",
875 875
 			(unsigned long) major(statbuf.st_rdev),
876 876
 			(unsigned long) minor(statbuf.st_rdev));
877
-#else /* !HAVE_ST_RDEV */
877
+#else /* !HAVE_STRUCT_STAT_ST_RDEV */
878 878
 		tprintf("st_size=makedev(%lu, %lu), ",
879 879
 			(unsigned long) major(statbuf.st_size),
880 880
 			(unsigned long) minor(statbuf.st_size));
881
-#endif /* !HAVE_ST_RDEV */
881
+#endif /* !HAVE_STRUCT_STAT_ST_RDEV */
882 882
 		break;
883 883
 	default:
884 884
 		tprintf("st_size=%llu, ", statbuf.st_size);
@@ -888,24 +888,24 @@ long addr;
888 888
 		tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
889 889
 		tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
890 890
 		tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
891
-#if HAVE_ST_FLAGS
891
+#if HAVE_STRUCT_STAT_ST_FLAGS
892 892
 		tprintf(", st_flags=");
893 893
 		if (statbuf.st_flags) {
894 894
 			printflags(fileflags, statbuf.st_flags);
895 895
 		} else
896 896
 			tprintf("0");
897 897
 #endif
898
-#if HAVE_ST_ACLCNT
898
+#if HAVE_STRUCT_STAT_ST_ACLCNT
899 899
 		tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
900 900
 #endif
901
-#if HAVE_ST_LEVEL
901
+#if HAVE_STRUCT_STAT_ST_LEVEL
902 902
 		tprintf(", st_level=%ld", statbuf.st_level);
903 903
 #endif
904
-#if HAVE_ST_FSTYPE
904
+#if HAVE_STRUCT_STAT_ST_FSTYPE
905 905
 		tprintf(", st_fstype=%.*s",
906 906
 			(int) sizeof statbuf.st_fstype, statbuf.st_fstype);
907 907
 #endif
908
-#if HAVE_ST_GEN
908
+#if HAVE_STRUCT_STAT_ST_GEN
909 909
 		tprintf(", st_gen=%u", statbuf.st_gen);
910 910
 #endif
911 911
 		tprintf("}");

+ 15
- 15
net.c View File

@@ -766,21 +766,21 @@ int addrlen;
766 766
 		tprintf("sin6_port=htons(%u), inet_pton(AF_INET6, \"%s\", &sin6_addr), sin6_flowinfo=%u",
767 767
 				ntohs(addrbuf.sa6.sin6_port), string_addr,
768 768
 				addrbuf.sa6.sin6_flowinfo);
769
-#ifdef HAVE_SIN6_SCOPE_ID
769
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
770 770
 		{
771 771
 #if defined(HAVE_IF_INDEXTONAME) && defined(IN6_IS_ADDR_LINKLOCAL) && defined(IN6_IS_ADDR_MC_LINKLOCAL)
772 772
 		    int numericscope = 0;
773 773
 		    if (IN6_IS_ADDR_LINKLOCAL (&addrbuf.sa6.sin6_addr)
774 774
 			    || IN6_IS_ADDR_MC_LINKLOCAL (&addrbuf.sa6.sin6_addr)) {
775 775
 			char scopebuf[IFNAMSIZ + 1];
776
-			
776
+
777 777
 			if (if_indextoname (addrbuf.sa6.sin6_scope_id, scopebuf) == NULL)
778 778
 			    numericscope++;
779 779
 			else
780 780
 			    tprintf(", sin6_scope_id=if_nametoindex(\"%s\")", scopebuf);
781 781
 		    } else
782 782
 			numericscope++;
783
-		    
783
+
784 784
 		    if (numericscope)
785 785
 #endif
786 786
 			tprintf(", sin6_scope_id=%u", addrbuf.sa6.sin6_scope_id);
@@ -798,7 +798,7 @@ int addrlen;
798 798
 			 * strace-ish, but otherwise the IPX
799 799
 			 * addresses just look monstrous...
800 800
 			 * Anyways, feel free if you don't like
801
-			 * this way.. :) 
801
+			 * this way.. :)
802 802
 			 */
803 803
 			tprintf("%08lx:", (unsigned long)ntohl(addrbuf.sipx.sipx_network));
804 804
 			for (i = 0; i<IPX_NODE_LEN; i++)
@@ -818,7 +818,7 @@ int addrlen;
818 818
 			tprintf(", addr(%d)={%d, ",
819 819
 					addrbuf.ll.sll_halen,
820 820
 					addrbuf.ll.sll_hatype);
821
-			for (i=0; i<addrbuf.ll.sll_halen; i++) 
821
+			for (i=0; i<addrbuf.ll.sll_halen; i++)
822 822
 				tprintf("%02x", addrbuf.ll.sll_addr[i]);
823 823
 		}
824 824
 		break;
@@ -860,17 +860,17 @@ long addr;
860 860
 	tprintf(", msg_iov(%lu)=", (unsigned long)msg.msg_iovlen);
861 861
 	tprint_iov(tcp, msg.msg_iovlen, (long) msg.msg_iov);
862 862
 
863
-#ifdef HAVE_MSG_CONTROL
863
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
864 864
 	tprintf(", msg_controllen=%lu", (unsigned long)msg.msg_controllen);
865
-	if (msg.msg_controllen) 
865
+	if (msg.msg_controllen)
866 866
 		tprintf(", msg_control=%#lx, ", (unsigned long) msg.msg_control);
867 867
 	tprintf(", msg_flags=");
868 868
 	if (printflags(msg_flags, msg.msg_flags)==0)
869 869
 		tprintf("0");
870
-#else /* !HAVE_MSG_CONTROL */
870
+#else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
871 871
 	tprintf("msg_accrights=%#lx, msg_accrightslen=%u",
872 872
 		(unsigned long) msg.msg_accrights, msg.msg_accrightslen);
873
-#endif /* !HAVE_MSG_CONTROL */
873
+#endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
874 874
 	tprintf("}");
875 875
 }
876 876
 
@@ -1208,7 +1208,7 @@ struct tcb *tcp;
1208 1208
 			tprintf("]");
1209 1209
 			break;
1210 1210
 #endif /* PF_IPX */
1211
-		default:	
1211
+		default:
1212 1212
 			tprintf("%lu", tcp->u_arg[2]);
1213 1213
 			break;
1214 1214
 		}
@@ -1265,7 +1265,7 @@ struct tcb *tcp;
1265 1265
 
1266 1266
 		/* SOL_AX25 SOL_ROSE SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
1267 1267
 		 * etc. still need work */
1268
-		default: 
1268
+		default:
1269 1269
 			tprintf("%lu", tcp->u_arg[2]);
1270 1270
 			break;
1271 1271
 		}
@@ -1404,7 +1404,7 @@ int len;
1404 1404
 		break;
1405 1405
 #endif
1406 1406
 
1407
-		/* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25 
1407
+		/* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
1408 1408
 		 * etc. still need work  */
1409 1409
 
1410 1410
 	    default:
@@ -1414,7 +1414,7 @@ int len;
1414 1414
 	/* default arg printing */
1415 1415
 
1416 1416
 	tprintf (", ");
1417
-		
1417
+
1418 1418
 	if (len == sizeof (int)) {
1419 1419
 		printnum(tcp, addr, "%ld");
1420 1420
 	}
@@ -1502,7 +1502,7 @@ int (*func) ();
1502 1502
 		for (i = 0; i < tcp->u_nargs; i++)
1503 1503
 			tcp->u_arg[i] = tcp->u_arg[i + 1];
1504 1504
 		return func (tcp);
1505
-		
1505
+
1506 1506
 	}
1507 1507
 
1508 1508
 	return func (tcp);
@@ -1581,7 +1581,7 @@ struct tcb *tcp;
1581 1581
 			tprintf ("%ld, ", tcp->u_arg [1]);
1582 1582
 		}
1583 1583
 		tprintf ("%ld, ", tcp->u_arg [2]);
1584
-	} 
1584
+	}
1585 1585
 	else {
1586 1586
 		if (tcp->u_arg[3] == 0 || syserror(tcp)) {
1587 1587
 			tprintf("%#lx", tcp->u_arg[3]);

+ 4
- 4
strace.c View File

@@ -1209,10 +1209,10 @@ int sig;
1209 1209
 
1210 1210
 #ifndef HAVE_STRERROR
1211 1211
 
1212
-#ifndef SYS_ERRLIST_DECLARED
1212
+#if !HAVE_DECL_SYS_ERRLIST
1213 1213
 extern int sys_nerr;
1214 1214
 extern char *sys_errlist[];
1215
-#endif /* SYS_ERRLIST_DECLARED */
1215
+#endif /* HAVE_DECL_SYS_ERRLIST */
1216 1216
 
1217 1217
 const char *
1218 1218
 strerror(errno)
@@ -1231,11 +1231,11 @@ int errno;
1231 1231
 
1232 1232
 #ifndef HAVE_STRSIGNAL
1233 1233
 
1234
-#ifndef SYS_SIGLIST_DECLARED
1235 1234
 #ifdef HAVE__SYS_SIGLIST
1235
+#if !HAVE_DECL_SYS_SIGLIST
1236
+extern char *sys_siglist[];
1236 1237
 	extern char *_sys_siglist[];
1237 1238
 #else
1238
-	extern char *sys_siglist[];
1239 1239
 #endif
1240 1240
 #endif /* SYS_SIGLIST_DECLARED */
1241 1241
 

+ 3
- 3
stream.c View File

@@ -481,7 +481,7 @@ static struct xlat transport_user_flags [] = {
481 481
 };
482 482
 
483 483
 
484
-#ifdef HAVE_T_OPTHDR
484
+#ifdef HAVE_STRUCT_T_OPTHDR
485 485
 
486 486
 static struct xlat xti_level [] = {
487 487
 	{ XTI_GENERIC,	"XTI_GENERIC"	},
@@ -562,9 +562,9 @@ int len;
562 562
 {
563 563
 	/* We don't know how to tell if TLI (socket) or XTI
564 564
 	   optmgmt is being used yet, assume TLI. */
565
-#if defined (HAVE_OPTHDR)
565
+#if defined (HAVE_STRUCT_OPTHDR)
566 566
 	print_sock_optmgmt (tcp, addr, len);
567
-#elif defined (HAVE_T_OPTHDR)
567
+#elif defined (HAVE_STRUCT_T_OPTHDR)
568 568
 	print_xti_optmgmt (tcp, addr, len);
569 569
 #else
570 570
 	printstr (tcp, addr, len);

Loading…
Cancel
Save