Marcus Brinkmann <[EMAIL PROTECTED]> writes: > MiG doesn't know unsigned short, so I am afraid that I have to use int. > The conversion from signed shorts to unsigned shorts is implementation > defined (or can raise a signal even), so I am out of luck here (unless we > forbid ports higher than 7fff).
unsigned short is just short with a ctype of "u_short" instead of "short". Note <mach/std_types.defs>, which does the following for 32-bit ints: type int = MACH_MSG_TYPE_INTEGER_32; type unsigned = MACH_MSG_TYPE_INTEGER_32; These are, as far as MiG cares, entirely identical; the difference is the type that gets written in the prototypes for the stubs. So you can just create type unsigned16 = MACH_MSG_TYPE_INTEGER_16; Then you'd have to add unsigned16 to the appropriate .h header. Or you can do: type u_short = MACH_MSG_TYPE_INTEGER_16; And then you are done, because u_short is already in <sys/types.h>. You could also do: type unsigned16 = MACH_MSG_TYPE_INTEGER_16 ctype: u_short; in which case the type has a different name between MiG and C. > I slowly realize what's involved with kernel side servers. There > are quite a few differences. For example, it seems variable size > length arguments must be either always in-line (array [*:MAX]) or > always out-of-line (^array []). Yes, I believe this is correct. It would be nice to extend the variable version to kernel side servers too, however. _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd