We have a way to call C library functions from the lisp. We process
the C headers with a custom ffigen and use the resulting data to know
the C types, number of arguments, and so forth.
When we call open(2) on 32-bit x86, though, something odd seems to be
happening.
From the libc sources (Libc-498/sys/open.c), we see
/*
* open stub: The legacy interface never automatically associated a
controlling
* tty, so we always pass O_NOCTTY.
*/
int
open(const char *path, int flags, mode_t mode)
{
return(__open_nocancel(path, flags | O_NOCTTY, mode));
}
The problem here is that if we call this with only two args, this code
will trash a word in the caller's frame (see [1] and [2] marked above).
Like I mentioned, we see the
int open(const char *, int, ...)
prototype in fcntl.h, and don't know anything about the
__DARWIN_ALIAS_C(open) stuff, which is why we end up calling the
"legacy" interface.
Do I need some remedial i386 ABI instruction? Or is something else
wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden