Dan McDonald writes: > showing up in various open-source packages. As far as I can tell, this macro > defines the length of the sun_family (two-bytes on OpenSolaris), plus the > string length of the pathname WITHOUT THE NULL TERMINATOR.
Yes; that's how it's supposed to be used. In general, interfaces should use either an explicit length or the ASCII NUL (0) terminator. Using both is lame. That's why UNIX-domain sockets use a counted length only with no terminator. > It appears that our sockets can do the right thing here (see copyin_name() in > $SRC/uts/common/fs/sockfs/socksyscalls.c), so I was curious if anyone would > have objections to inserting SUN_LEN() into our own <sys/un.h> or not? Do it. But make sure you get the necessary prototype for 'strlen' right. Either add a nested include for <string.h> or (yecch) put a duplicate extern here. Header files should be able to stand alone. -- James Carlson, Solaris Networking <[EMAIL PROTECTED]> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 _______________________________________________ networking-discuss mailing list [email protected]
