From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 25 May 2012 01:14:42 -0400 To: 9fans@9fans.net Message-ID: <61b33d5171eaeeec500292dd2d983a56@brasstown.quanstro.net> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] exec crashing Topicbox-Message-UUID: 95530c26-ead7-11e9-9d60-3106f5b1d025 On Thu May 24 23:03:19 EDT 2012, burton.samograd@gmail.com wrote: > I'm trying to add a restart feature to my modified rio by calling exec on a > saved argv[0] and copy of argv that has been null terminated, but it crashes > every time. Is there something about exec on plan9 that I should be aware > of that's different than unix? no, there's not. however, rio is a thread-library program and you can't just exec() out without confusing other processes you're sharing memory with. rio already has a hook where it will provide an Exit menu option if ".out" appears somewhere in argv[0]. so, you could have an rc script named rio, and rename rio to rio.out. the rc script would just need to read something like #!/bin/rc while() rio.out $* - erik