That's history for you.
Ideally, it would be const void*, then you could point at anything you liked so long as you also set msg_len to be the right size.
For most machines, you can do
(const char *)&myvar, sizeof(myvar)
kinda thing.
A small wrapper function taking a void* instead would help keep your code nice and tidy (and give you an easy way out if pointer representations was an issue).
The standard C library functions which take "pointer to some memory and a size" have all (I think) been updated to use void*, rather than the historic char*. But POSIX seems to be sticking with the old for now.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953