Discussion:
[9fans] exec crashing
(too old to reply)
Burton Samograd
2012-05-25 03:01:49 UTC
Permalink
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?

--
Burton Samograd
erik quanstrom
2012-05-25 05:14:42 UTC
Permalink
Post by Burton Samograd
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

Continue reading on narkive:
Loading...