www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/13/06:20:02

Date: Thu, 13 Nov 1997 13:13:20 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Andrew Crabtree <andrewc AT rosemail DOT rose DOT hp DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Port of bzip2
In-Reply-To: <64dfva$sva$1@rosenews.rose.hp.com>
Message-ID: <Pine.SUN.3.91.971113130719.23653C-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019