9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] exec crashing
Date: Fri, 25 May 2012 01:14:42 -0400	[thread overview]
Message-ID: <61b33d5171eaeeec500292dd2d983a56@brasstown.quanstro.net> (raw)
In-Reply-To: <CAM8pOuOuDjzxb=c_Nmf0dnJyMVta7qbq9M732m6V4zEZ-V8ycA@mail.gmail.c>

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



       reply	other threads:[~2012-05-25  5:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAM8pOuOuDjzxb=c_Nmf0dnJyMVta7qbq9M732m6V4zEZ-V8ycA@mail.gmail.c>
2012-05-25  5:14 ` erik quanstrom [this message]
2012-05-25  3:01 Burton Samograd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61b33d5171eaeeec500292dd2d983a56@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).