Mail Archives: djgpp/1997/11/13/06:20:02
On Wed, 12 Nov 1997, Andrew Crabtree wrote:
> DJGPP does not define a SIGBUS for some reason (maybe we can't trap it).
AFAIK, there's no such thing as SIGBUS on machines which don't require
alignment. x86 can handle misaligned objects, they just inflict runtime
penalty. Machines that have SIGBUS cannot access misaligned objects at
all.
> #ifndef __DJGPP__
> signal (SIGBUS, mySIGSEGVorSIGBUScatcher);
> #endif
A better way is to check SIGBUS itself:
#ifdef SIGBUS
signal (SIGBUS, ...);
#endif
> #ifdef __DJGPP__
> #define MY_LSTAT stat
> #else
> #define MY_LSTAT lstat
> #endif
Here, also, a better way is to test for the (un)supported feature rather
than for a system name:
#ifdef S_ISLNK
#define MY_LSTAT lstat
#else
#define MY_LSTAT stat
#endif
(since `lstat' only makes sense when symbolic links are supported).
- Raw text -