/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
$Id$

$Date$
 */


#ifndef ←←PCR←errno←h
#define ←←PCR←errno←h 	1

/*
 * Standard POSIX errno values
 */

#include <host/errno.h>

/*
 * per-thread error number
 */

#ifndef PCR←GetErrnoAddress
    extern int (*(PCR←GetErrnoAddress(void)));
#endif

#define PCR←GetErrno() (*(PCR←GetErrnoAddress()))

#define PCR←SetErrno(err) (*(PCR←GetErrnoAddress())) = (err)


/*
 * errno values from PCR itself
 */

#define PCR←←EPCRBASE		1024
#define PCR←EPCR(x)		(PCR←←EPCRBASE+(x))

#define PCR←EINTERNAL		PCR←EPCR(0)	/* should never be seen */
#define PCR←ETIMEDOUT		PCR←EPCR(1)


/*
 * Human readable error messages
 */

extern void
PCR←perror(const char *s);
/*
    Print an error message (constructd from s and errno) on stderr.
    This function is also declared in stdio.h.
*/


extern char *
PCR←strerror(int n);
/*
    Return error message appropriate for abs(errno), in a static buffer.
    Return catchall message if errno is out of range.
    This function is also declared in string.h.
*/


#ifndef PCR←NO←RENAME

#   undef errno
#   define errno (*(PCR←GetErrnoAddress()))

#   undef perror
#   define perror PCR←perror

#   undef strerror
#   define strerror PCR←strerror

#endif /* !PCR←NO←RENAME */

#endif /* !←←PCR←errno←h */

/*
$Log$
*/