[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: thread safe error number
hii,
We faced a similar problem when working on a Solaris system.
we were using a multithreaded application and the code used the 'errno'
set by system calls to make some decision. Initially the code misbehaved
because errno was mapped to a global variable instead of thread specific
errno.
then we enabled a flag -D_REENTRANT while compiling. The code worked.
for code using posix threads _POSIX_C_SOURCE >= 199506L should suffice.
in linux -D_LIBC_REENTRANT should be used ... (because it uses GNU libc)
in linux the 'errno' is mapped to a function in bits/errno.h under that
flag
-bharani
-----Original Message-----
From: kernelnewbies-bounce@nl.linux.org
[mailto:kernelnewbies-bounce@nl.linux.org]On Behalf Of David Davy
Sent: Wednesday, 3 April 2002 9:14 AM
To: kernelnewbies@nl.linux.org
Subject: thread safe error number
Hi, every one:
I'm working on some codes between userland and kernel space. But, I couldn't
get the correct error number via global variable 'errno' because of its
no-thread-safe property. Any suggestions?
Many thanks
David
--
To the systems programmer, users and applications serve only to provide a
test load.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
***************************************************************************
This message is proprietary to Future Software Limited (FSL)
and is intended solely for the use of the individual to whom it
is addressed. It may contain privileged or confidential information
and should not be circulated or used for any purpose other than for
what it is intended.
If you have received this message in error, please notify the
originator immediately. If you are not the intended recipient,
you are notified that you are strictly prohibited from using,
copying, altering, or disclosing the contents of this message.
FSL accepts no responsibility for loss or damage arising from
the use of the information transmitted by this email including
damage from virus.
***************************************************************************
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/