Re: [cc65] Calling another program: exec() ?

From: <>
Date: 2011-01-25 19:44:55
On 2011-01-25, at 16:58, Ullrich von Bassewitz wrote:

> Hi!
> On Tue, Jan 25, 2011 at 12:12:30PM +0100, Oliver Schmidt wrote:
>>> Having an error code allows an "explanation" of the failure.
>> The execl() function and friends just return -1 and set errno for  
>> more
>> details. I presumed that exec() would behave the same...
> As I've found out, when writing the funcref entry (see below),  
> returning an
> error in errno will probably not work in most cases, since when we  
> load the
> new program, the old one has already terminated, files have been  
> closed and
> the destructors have been run.

That will be later. Most of the things that may go wrong (ENOENT,  
ENFILE, etc.) can be caught during the prepping. So it makes perfect  
sense to me.

> It may be possible to return on some errors, so
> I think the error code is still a good idea and not too much overhead.

Yup. :-)

> [...]

> Please let me know if there is anything wrong or missing. Maybe we  
> want to
> allow a NULL pointer for cmdline?

Yes. I guess in more cases than not it is going to be used without  
actual command line passed.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Jan 25 19:45:04 2011

This archive was generated by hypermail 2.1.8 : 2011-01-25 19:45:07 CET