[racket] Program compiles with racket fails when invoked with execl()

From: bbi5291 (bbi5291 at gmail.com)
Date: Fri Sep 17 05:14:15 EDT 2010

All right, I figured out that it works correctly when argv[0] is set to
"./aplusb". I have a different question though: is there any feature that
allows one to limit the amount of memory that a compiled program is allowed
to use, similar to the "Limit Memory" command in DrRacket?

On Fri, Sep 17, 2010 at 4:32 AM, bbi5291 <bbi5291 at gmail.com> wrote:

> Consider the simple Racket program
>
> --------------------
> #lang racket
> (+ (read) (read))
> --------------------
>
> When this is compiled using raco, the executable produced works exactly as
> intended, reading two integers on standard input and printing their sum.
> However, when I run the C program
>
> --------------------
> #include <unistd.h>
> int main()
> {
>         execl("aplusb","aplusb",(char*)0);
> }
> --------------------
>
> where "aplusb" is the name of the Racket program, it exits immediately with
> the errors:
>
> --------------------
> with-input-from-file: expects type <path or string> as 1st argument, given:
> #f; other arguments were: #<procedure>
>
>  === context ===
> embedded-load
>
> --------------------
>
> How can I fix this problem? I am using Racket v5.0.1 on Ubuntu 9.10 (i386).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100917/85581129/attachment.html>

Posted on the users mailing list.