__errno_location() like functionality in Cygwin
Dmitry Timoshkov
dmitry@sloboda.ru
Thu May 3 03:37:00 GMT 2001
Hello.
I'm new to this list. I'd like to know, is it possible to define
my own __errno() function, which will provide functionality like
__errno_location() in linux?
This simple program works in linux, but doesn't under Cygwin:
static int myerrno = 0;
static char buf[256];
int *__errno_location(void)
{
return &myerrno;
}
int *__errno(void)
{
return &myerrno;
}
int main(void)
{
int ret;
/* provoke an error */
ret = read(-1, buf, 255);
printf("ret = %d, myerrno = %d\n", ret, myerrno);
return 0;
}
Any suggestions?
Thanks in advance.
--
Dmitry.
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list