[prev in list] [next in list] [prev in thread] [next in thread] 

List:       strace
Subject:    patch to follow freebsd rfork correctly
From:       "Russ Cox" <rsc () plan9 ! bell-labs ! com>
Date:       2003-01-13 18:09:32
[Download RAW message or body]

This should go either into strace or into the FreeBSD ports patches.
It makes strace -f follow rforks properly.  The change to syscall.c
adds the case for rfork, and the change to process.c doesn't try to
trace the cases when rfork has not created a new process.

Enjoy.
Russ Cox

frenulum=; diff -c syscall.c.before-rsc syscall.c
*** syscall.c.before-rsc	Mon Jan 13 13:03:20 2003
--- syscall.c	Mon Jan 13 13:04:25 2003
***************
*** 603,608 ****
--- 603,611 ----
  #ifdef SYS_rforkall
  	case SYS_rforkall:
  #endif
+ #ifdef SYS_rfork
+ 	case SYS_rfork:
+ #endif
  		internal_fork(tcp);
  		break;
  #ifdef SYS_clone
frenulum=; diff -c process.c.before-rsc process.c
*** process.c.before-rsc	Mon Jan 13 13:03:17 2003
--- process.c	Mon Jan 13 13:04:20 2003
***************
*** 393,398 ****
--- 393,402 ----
  	struct tcb *tcpchild;
  
  	if (exiting(tcp)) {
+ #ifdef SYS_rfork
+ 		if (tcp->scno == SYS_rfork && !(tcp->u_arg[0]&RFPROC))
+ 			return 0;
+ #endif
  		if (getrval2(tcp))
  			return 0;
  		if (!followfork)
frenulum=; 



-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic