%n strace %v 3.1 %c * %l * %b * %d * %f * %t strace-3.1.tgz %w Misc %% %setup patch -u -p1 <<'ENDPATCH' diff -ru2N strace-3.1/Makefile.in strace-MCC/Makefile.in --- strace-3.1/Makefile.in Mon May 20 05:39:40 1996 +++ strace-MCC/Makefile.in Sun Sep 8 11:56:34 1996 @@ -16,5 +16,5 @@ LDLIBS = @LIBS@ -CFLAGS = @CFLAGS@ +CFLAGS = -O6 -fomit-frame-pointer CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ @@ -59,6 +59,7 @@ install: all - $(INSTALL_PROGRAM) strace $(bindir)/strace - $(INSTALL_DATA) $(srcdir)/strace.1 $(man1dir)/strace$(man1ext) + install -s -m 555 strace $(bindir)/strace + install -m 444 $(srcdir)/strace.1 $(man1dir)/strace$(man1ext) + gzip -9f $(man1dir)/strace$(man1ext) clean: clean-local diff -ru2N strace-3.1/mem.c strace-MCC/mem.c --- strace-3.1/mem.c Sun May 19 06:40:36 1996 +++ strace-MCC/mem.c Sun Sep 8 11:24:51 1996 @@ -92,4 +92,7 @@ { MAP_EXECUTABLE,"MAP_EXECUTABLE"}, #endif +#ifdef MAP_LOCKED + { MAP_LOCKED,"MAP_LOCKED"}, +#endif { 0, NULL }, }; diff -ru2N strace-3.1/net.c strace-MCC/net.c --- strace-3.1/net.c Tue May 21 03:20:57 1996 +++ strace-MCC/net.c Sun Sep 8 11:51:56 1996 @@ -37,4 +37,7 @@ #include #include +#ifdef LINUX +#include +#endif #ifndef PF_UNSPEC @@ -59,4 +62,28 @@ { PF_ISO, "PF_ISO" }, #endif +#ifdef PF_AX25 + { PF_AX25, "PF_AX25" }, +#endif +#ifdef PF_IPX + { PF_IPX, "PF_IPX" }, +#endif +#ifdef PF_APPLETALK + { PF_APPLETALK, "PF_APPLETALK" }, +#endif +#ifdef PF_NETROM + { PF_NETROM, "PF_NETROM" }, +#endif +#ifdef PF_BRIDGE + { PF_BRIDGE, "PF_BRIDGE" }, +#endif +#ifdef PF_AAL5 + { PF_AAL5, "PF_AAL5" }, +#endif +#ifdef PF_X25 + { PF_X25, "PF_X25" }, +#endif +#ifdef PF_INET6 + { PF_INET6, "PF_INET6" }, +#endif #ifdef PF_IMPLINK { PF_IMPLINK, "PF_IMPLINK" }, @@ -113,4 +140,7 @@ { IPPROTO_MAX, "IPPROTO_MAX" }, #endif +#ifdef IPPROTO_IPIP + { IPPROTO_IPIP, "IPPROTO_IPIP" }, +#endif { 0, NULL }, }; @@ -123,4 +153,10 @@ { MSG_PEEK, "MSG_PEEK" }, #endif +#ifdef MSG_CTRUNC + { MSG_CTRUNC, "MSG_CTRUNC" }, +#endif +#ifdef MSG_PROXY + { MSG_PROXY, "MSG_PROXY" }, +#endif { 0, NULL }, }; @@ -183,8 +219,48 @@ #ifdef SO_RCVTIMEO { SO_RCVTIMEO, "SO_RCVTIMEO" }, +#ifdef SO_BSDCOMPAT + { SO_BSDCOMPAT, "SO_BSDCOMPAT" }, +#endif +#ifdef SO_REUSEPORT + { SO_REUSEPORT, "SO_REUSEPORT" }, +#endif #endif { 0, NULL }, }; +#ifdef SOL_IP +static struct xlat sockipoptions[] = { + { IP_TOS, "IP_TOS" }, + { IP_TTL, "IP_TTL" }, +#if defined(IP_HDRINCL) + { IP_HDRINCL, "IP_HDRINCL" }, +#endif +#if defined(IP_OPTIONS) + { IP_OPTIONS, "IP_OPTIONS" }, +#endif + { IP_MULTICAST_IF, "IP_MULTICAST_IF" }, + { IP_MULTICAST_TTL, "IP_MULTICAST_TTL" }, + { IP_MULTICAST_LOOP, "IP_MULTICAST_LOOP" }, + { IP_ADD_MEMBERSHIP, "IP_ADD_MEMBERSHIP" }, + { IP_DROP_MEMBERSHIP, "IP_DROP_MEMBERSHIP" }, + { 0, NULL }, +}; +#endif /* SOL_IP */ + +#ifdef SOL_IPX +static struct xlat sockipxoptions[] = { + { IPX_TYPE, "IPX_TYPE" }, + { 0, NULL }, +}; +#endif /* SOL_IPX */ + +#ifdef SOL_TCP +static struct xlat socktcpoptions[] = { + { TCP_NODELAY, "TCP_NODELAY" }, + { TCP_MAXSEG, "TCP_MAXSEG" }, + { 0, NULL }, +}; +#endif /* SOL_TCP */ + void printsock(tcp, addr) @@ -195,4 +271,7 @@ struct sockaddr_in *sin = (struct sockaddr_in *) &sa; struct sockaddr_un sau; +#ifdef LINUX + struct sockaddr_ipx sipx; +#endif if (addr == 0) { @@ -221,4 +300,21 @@ ntohs(sin->sin_port), inet_ntoa(sin->sin_addr)); break; +#ifdef AF_IPX + case AF_IPX: + if (umove(tcp, addr, &sipx)<0) + tprintf("{sipx_family=AF_IPX, ...}"); + else { + int i; + tprintf("{sipx_family=AF_IPX, "); + tprintf("{sipx_port=htons(%u), ", + ntohs(sipx.sipx_port)); + tprintf("%08lx:", ntohl(sipx.sipx_network)); + for (i = 0; iu_arg[0] == PF_INET) + switch (tcp->u_arg[0]) { + case PF_INET: printxval(protocols, tcp->u_arg[2], "IPPROTO_???"); - else + break; +#ifdef PF_IPX + case PF_IPX: + tprintf("["); + printxval(domains, tcp->u_arg[2], "PF_???"); + tprintf("]"); + break; +#endif /* PF_IPX */ + default: tprintf("%lu", tcp->u_arg[2]); + break; + } } return 0; @@ -544,8 +651,18 @@ printxval(socktypes, tcp->u_arg[1], "SOCK_???"); tprintf(", "); - if (tcp->u_arg[0] == PF_INET) { + switch (tcp->u_arg[0]) { + case PF_INET: printxval(protocols, tcp->u_arg[2], "IPPROTO_???"); - } else { + break; +#ifdef PF_IPX + case PF_IPX: + tprintf("["); + printxval(domains, tcp->u_arg[2], "PF_???"); + tprintf("]"); + break; +#endif /* PF_IPX */ + default: tprintf(", %lu", tcp->u_arg[2]); + break; } } else { @@ -576,12 +693,38 @@ if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); - if (tcp->u_arg[1] == SOL_SOCKET) { + switch (tcp->u_arg[1]) { + case SOL_SOCKET: tprintf("SOL_SOCKET, "); printxval(sockoptions, tcp->u_arg[2], "SO_???"); tprintf(", "); - } else { + break; +#ifdef SOL_IP + case SOL_IP: + tprintf("SOL_IP, "); + printxval(sockipoptions, tcp->u_arg[2], "IP_???"); + tprintf(", "); + break; +#endif +#ifdef SOL_IPX + case SOL_IPX: + tprintf("SOL_IPX, "); + printxval(sockipxoptions, tcp->u_arg[2], "IPX_???"); + tprintf(", "); + break; +#endif +#ifdef SOL_TCP + case SOL_TCP: + tprintf("SOL_TCP, "); + printxval(socktcpoptions, tcp->u_arg[2], "TCP_???"); + tprintf(", "); + break; +#endif + + /* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP etc. still need work */ + default: /* XXX - should know socket family here */ printxval(protocols, tcp->u_arg[1], "IPPROTO_???"); tprintf("%lu, ", tcp->u_arg[2]); + break; } } else { @@ -604,12 +747,37 @@ if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); - if (tcp->u_arg[1] == SOL_SOCKET) { + switch (tcp->u_arg[1]) { + case SOL_SOCKET: tprintf("SOL_SOCKET, "); printxval(sockoptions, tcp->u_arg[2], "SO_???"); tprintf(", "); - } else { + break; +#ifdef SOL_IP + case SOL_IP: + tprintf("SOL_IP, "); + printxval(sockipoptions, tcp->u_arg[2], "IP_???"); + tprintf(", "); + break; +#endif +#ifdef SOL_IPX + case SOL_IPX: + tprintf("SOL_IPX, "); + printxval(sockipxoptions, tcp->u_arg[2], "IPX_???"); + tprintf(", "); + break; +#endif +#ifdef SOL_TCP + case SOL_TCP: + tprintf("SOL_TCP, "); + printxval(socktcpoptions, tcp->u_arg[2], "TCP_???"); + tprintf(", "); + break; +#endif + + default: /* XXX - should know socket family here */ printxval(protocols, tcp->u_arg[1], "IPPROTO_???"); tprintf("%lu, ", tcp->u_arg[2]); + break; } printnum(tcp, tcp->u_arg[3], "%ld"); ENDPATCH ./configure --prefix=/usr make * make install %%