Friday, 8 November 2013

Re: [Rpcemu] Building RPCEmu on OpenBSD (patch attached)


1. Under OpenBSD, off_t is always 64-bit, so there's no separate fseeko64() etc.  There's already something for this for Mach in rpcemu.h, so I've added ' || defined __OpenBSD__' to switch this code in for OpenBSD too.

2. hostfs.c was looking for utime.h in the wrong place --- whether to look for sys/utime.h or just utime.h was defined by __MACH__ or __unix being defined.  OpenBSD doesn't define __unix under gcc.  So I've added ' || defined __OpenBSD__' to that line, too.

3. rpcemu.h was deciding that the machine I was on was big-endian.  This is because it was testing for _BIG_ENDIAN being /defined/ -- under OpenBSD both _BIG_ENDIAN and _LITTLE_ENDIAN are /always/ defined, and _BYTE_ORDER switches between them.  Likewise, so are BIG_ENDIAN and LITTLE_ENDIAN, with BYTE_ORDER switching between /those/.  So the patch checks whether _BIG_ENDIAN is defined and then checks whether _BYTE_ORDER is is _BIG_ENDIAN.  It doesn't remove the __BIG_ENDIAN__ check.

1. This looks fine, so I have committed this already.

2. I think <utime.h> is right for every platform we're interested in, and I can't find a platform where <sys/utime.h> is needed instead. Once I've confirmed this I'll change it to just use <utime.h> everywhere.

3. Can you look at the config.h generated by the autoconf script? Does this correctly set/unset the value WORDS_BIGENDIAN? If so, I'll change rpcemu.h to use this in preference.

Thanks

Matthew

No comments:

Post a Comment