Re: Workaround for hostid on Darwin 8/MacPPC

2007-05-04 Thread C. Speare
Ah, true. I'll lean on Apple to provide a non-broken gethostid(), since I can't think of a nice (clean, portable) way to handle this. Thank you. On Thu, 3 May 2007, John Cowan wrote: C. Speare scripsit: A possible (but weak) workaround is to test for the case where id is 0. It's fine to

Re: Workaround for hostid on Darwin 8/MacPPC

2007-05-04 Thread C. Speare
Ok, a (hopefully) better idea. If the value of id is 0, don't return anything and exit with EXIT_FAILURE. That maintains consistency and makes the user aware that something is seriously broken. [By the same view, returning a well-known value, like 0xdeadbeef or similar, could serve the same

Workaround for hostid on Darwin 8/MacPPC

2007-05-03 Thread C. Speare
Output of uname -a: Darwin ppc7447.local 8.9.0 Darwin Kernel Version 8.9.0: Thu Feb 22 20:54:07 PST 2007; root:xnu-792.17.14~1/RELEASE_PPC Power Macintosh powerpc PowerMac10,1 Darwin output of hostid --version: hostid (GNU coreutils) 6.9 Built using gcc 4.0.4 [custom compiled] plus the

Re: Workaround for hostid on Darwin 8/MacPPC

2007-05-03 Thread John Cowan
C. Speare scripsit: A possible (but weak) workaround is to test for the case where id is 0. It's fine to detect that case, but the whole idea of hostid is to return the same value each time it's called on the same host, so returning a random value is unhelpful. -- Work hard,