public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Mumit Khan <khan@nanotech.wisc.edu>
To: Erik Hensema <erik.hensema@group2000.nl>
Cc: "'Pthreads-win32'" <pthreads-win32@sourceware.cygnus.com>
Subject: Re: Linking pthread.dll to another dll
Date: Tue, 09 Nov 1999 07:40:00 -0000	[thread overview]
Message-ID: <199911091539.JAA29450@mercury.xraylith.wisc.edu> (raw)
In-Reply-To: <A01E735D4940D311A3850090275559330BA99C@NTSRV02>

Erik Hensema <erik.hensema@group2000.nl> writes:
> Hi,
> 
> I'm porting a shared library from Unix to NT, and I'm using pthread.dll for
> the multithreaded support.
> I'm having trouble using errno and the lib. Using the debugger, I can see
> that errno seems to be a function (huh? why does errno = x; work???). In my
> source, errno is a variable. Obiviously, errno doesn't change after a call
> to a pthread function.
> 
> What can I do to make errno work? And, how is errno implemented in the
> pthread dll? Is it some C++ syntax or something? My source is Ansi C.


The errno is implemented as a macro on (most, if not all of the) MT
capable runtime libraries, and you need to be careful not to make the 
usual mistake that's in lots of code developed under older varieties 
of Unix:
  
  extern int errno;
  /* use errno. */

The correct form is:

  #include <errno.h>
  /* use errno. */

Regards,
Mumit

      reply	other threads:[~1999-11-09  7:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-09  7:05 Erik Hensema
1999-11-09  7:40 ` Mumit Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199911091539.JAA29450@mercury.xraylith.wisc.edu \
    --to=khan@nanotech.wisc.edu \
    --cc=erik.hensema@group2000.nl \
    --cc=pthreads-win32@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).