delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/03/06:37:46

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <001501c0d3c4$bf0af130$26823bd5@dima>
From: "Dmitry Timoshkov" <dmitry AT sloboda DOT ru>
To: <cygwin AT cygwin DOT com>
Subject: __errno_location() like functionality in Cygwin
Date: Thu, 3 May 2001 19:32:25 +0800
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-MDRcpt-To: cygwin AT cygwin DOT com
X-MDRemoteIP: 213.59.130.38
X-Return-Path: dmitry AT sloboda DOT ru
X-MDaemon-Deliver-To: cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019