/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ */ #ifndef __PCR_errno_h #define __PCR_errno_h 1 /* * Standard POSIX errno values */ #include /* * 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$ */