On Wednesday 05 April 2006 19:13, Robert Epprecht wrote:
> Bernd Paysan <[EMAIL PROTECTED]> writes:
> > Look like you have no ffcall library
>
> OK, it's working now, thank you.
>
> man open(2) says:
>    open  and  creat  return  the  new  file  descriptor, or -1 if an
> error occurred (in which case, errno is set appropriately).
>
> I get -1. How can I access errno?

Under Linux, the function __errno_location returns a pointer to errno.

However, your declaration is wrong. You say int int ptr, but the 
signature of open() is ptr int int. Gforth reverses C's stack, so you 
really have to pass the pointer to the string first, and then the 
integer arguments.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/

Attachment: pgp3JFDZq9ARM.pgp
Description: PGP signature

Reply via email to