Over zealous redefinition of bzero creates portability issues

Richard Sharpe rsharpe at richardsharpe.com
Mon Jun 16 15:12:26 GMT 2003

On Mon, 16 Jun 2003, Martin Pool wrote:

> On 16 Jun 2003, jra at dp.samba.org wrote:
> > AIX too :-). This is why these OS's suck and are dying (like *BSD,
> > read /. for details :-). Seriously, bzero is not in spec 1170 and
> > shouldn't be used in portable code. Typical of most vendors that
> > they do.
> I have seen subtle bugs because of people getting the arguments to
> memset() the wrong way around, which will not give a warning.  bzero()
> nicely avoids this problem and I think it's far better for that
> reason, and anyhow, it's easy to implement on systems that are missing
> it.  
> I guess something like ZERO_STRUCT is adequate though.

Yes, buut the problem is use of bzero by system include files. FD_ZERO is 
implemented as a macro using bzero on AIX, Slowaris and FreeBSD, it seems.

Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com

More information about the samba-technical mailing list