Make errno finally and permanently thread-aware so that it is no longer

necessary to compile with _THREAD_SAFE defined. This means that people
will get thread-aware code whether they like it or not. This change
is required to allow a process to link against libpthread and libc
to use kernel threads (and prevent each thread from clobbering another
thread's errno just be doing a syscall).

This is bound to break some ports, but it is strictly allowed by ANSI C,
so anything that breaks as a result was already broken anyway 8-).
"Sorry".
This commit is contained in:
John Birrell 1998-04-30 09:38:03 +00:00
parent 3fece7a1aa
commit 1b46cb523d
1 changed files with 1 additions and 5 deletions

View File

@ -36,22 +36,18 @@
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
* $Id: errno.h,v 1.8 1997/12/06 11:28:06 bde Exp $
* $Id: errno.h,v 1.9 1998/04/13 17:45:00 sos Exp $
*/
#ifndef _SYS_ERRNO_H_
#define _SYS_ERRNO_H_
#ifndef KERNEL
#ifdef _THREAD_SAFE
#include <sys/cdefs.h>
__BEGIN_DECLS
int * __error __P((void));
__END_DECLS
#define errno (* __error())
#else
extern int errno; /* global error number */
#endif
#endif
#define EPERM 1 /* Operation not permitted */