[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Mon Apr 19 08:45:07 CEST 2010
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 10/04/19 08:45:07
Modified files:
cm3/m3-libs/libm3/src/uid/POSIX/: MachineIDPosixC.c
Log message:
extend better support to MacOSX, OpenBSD (tested)
and presumably FreeBSD and NetBSD (not tested, presumed to be same as OpenBSD)
keeping support for Linux, Cygwin (tested)
(but skipping loopback now, not that I saw it happen, but found this code..)
keeping lame fallback for Solaris (tested, nothing better found, unless running as root)
#error for anything else (OSF, Irix, AIX, Interix, VMS, HP-UX)
somewhat guessing how to detect them, but also using known ways
to check for supported systems so ok
Code is present for OSF but should be tested.
AIX, HP-UX, Interix solutions are on network, if they don't resemble what we have, VMS not known.
Each system needs to be tested.
(Ok, well, I didn't test FreeBSD And NetBSD, but if they compile, they
probably work and I can get to those systems reasonably easily enough.)
Strongly consider keeping the lame fallback only for Solaris.
In particular, almost all machines do have MAC addresses.
Many machines are on private networks, providing not very unique IPv4 addresses.
Some machines may have IP address but no MAC e.g. for dialup networking.
So the lame fallback left in for all platforms.
Posix says gethostname is limited to 255, which isn't so large, so grow
our buffer to the maximum 256.
(This is aka netdb.h MAXHOSTNAMELEN, but we use 256 here.)
More information about the M3commit
mailing list