[OpenIndiana-discuss] struct msghdr and _XPG4_2
the outsider
openindiana at out-side.nl
Wed May 25 08:11:20 UTC 2016
http://stackoverflow.com/questions/1034587/how-does-xpg4-2-and-other-defines
-work-on-solaris
-----Oorspronkelijk bericht-----
Van: Alexander Pyhalov [mailto:alp at rsu.ru]
Verzonden: woensdag 25 mei 2016 9:16
Aan: Discussion list for OpenIndiana <openindiana-discuss at openindiana.org>
Onderwerp: [OpenIndiana-discuss] struct msghdr and _XPG4_2
Hi.
It seems illumos/Solaris is the only OS which doesn't have msg_control and
msg_controllen in struct msghdr by default. So, code like this (this time
taken from scrren), fails.
struct sockaddr_un a;
struct msghdr msg;
struct iovec iov;
char control[1024];
len = sizeof(a);
debug("Ha, there was someone knocking on my socket??\n");
if ((ns = accept(ns, (struct sockaddr *) &a, (void *)&len)) < 0)
{
Msg(errno, "accept");
return;
}
p = (char *) &m;
left = sizeof(m);
bzero(&msg, sizeof(msg));
iov.iov_base = &m;
iov.iov_len = left;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_controllen = sizeof(control);
msg.msg_control = &control;
I know I can define _XPG4_2 or experiment with _XOPEN_SOURCE, but it seems
ugly. Is it because of some standard requirements or just historical
artifact? Can we somehow alleviate this issue?
--
Best regards,
Alexander Pyhalov,
system administrator of Southern Federal University IT department
_______________________________________________
openindiana-discuss mailing list
openindiana-discuss at openindiana.org
http://openindiana.org/mailman/listinfo/openindiana-discuss
More information about the openindiana-discuss
mailing list