9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Alef program to fork and exec say program
@ 1999-05-13 10:02 rog
  0 siblings, 0 replies; 3+ messages in thread
From: rog @ 1999-05-13 10:02 UTC (permalink / raw)


> void
> say(byte *msg)
> {
> 	rfork(RFENVG|RFFDG|RFNOTEG|RFMEM);
> 	execl("/bin/pub/say", "-l /dev/audio -C 2", "New mail arrived
> 			from ", msg);
> }

surely you want to fork a new process for the say rather than overwriting
the old one?

i haven't looked at the source, but perhaps invoking
	proc say(buf);
might serve you better?

  rog.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] Alef program to fork and exec say program
@ 1999-05-13 10:27 okamoto
  0 siblings, 0 replies; 3+ messages in thread
From: okamoto @ 1999-05-13 10:27 UTC (permalink / raw)


Thanks rog.

>	proc say(buf);
>might serve you better?

That's it!  

Yes, the Mail program works fine now, and he spaeks to me 
where the new mail arriverd from.

Kenji




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] Alef program to fork and exec say program
@ 1999-05-13  9:11 okamoto
  0 siblings, 0 replies; 3+ messages in thread
From: okamoto @ 1999-05-13  9:11 UTC (permalink / raw)


I'm trying to make my PC termianl read the From header
for a new incoming mail.

After reading the sources in /acme/mail/src, I made small
changes to the function Box.readmore() in box.l like as:

in while() loop to read new comming mails,
	new = true;
	say(buf);      <----added line

and 

defined say() in the box.l file like

void
say(byte *msg)
{
	rfork(RFENVG|RFFDG|RFNOTEG|RFMEM);
	execl("/bin/pub/say", "-l /dev/audio -C 2", "New mail arrived
			from ", msg);
}

After above change, (I really don't know whether the flags 
for rfork() are approapriate) the rsynth program reads and 
speaks! the "From" and "Subject" line when a new mail arrived 
to me.  
However, after that, the Mail program goes into mad, and I 
cann't end the session clearly.
Then, I searched the on-line manuals, and found something
notices for exec() in Alef environment, saying exec() may be
called only from the mail task....

If I want to fork/exec a new program like the present case,
can I do it otherwise?

Kenji




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-05-13 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-13 10:02 [9fans] Alef program to fork and exec say program rog
  -- strict thread matches above, loose matches on Subject: below --
1999-05-13 10:27 okamoto
1999-05-13  9:11 okamoto

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).