summaryrefslogtreecommitdiff
path: root/mcon/U/d_sendmsg.U
blob: 8c29f46e92c6c56228782eb6d4e99ee89634f865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
?RCS: $Id: d_sendmsg.U 170 2013-08-30 16:47:47Z rmanfredi $
?RCS:
?RCS: Copyright (c) 2006, Christian Biere
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?MAKE:d_sendmsg: Trylink cat i_systypes i_sysselct i_syssock \
	i_winsock2 i_mswsock d_windows
?MAKE:	-pick add $@ %<
?S:d_sendmsg:
?S:	This variable conditionally defines the HAS_SENDMSG symbol,
?S:	which indicates to the C program that the sendmsg() function is
?S:	available.
?S:.
?C:HAS_SENDMSG:
?C:	This symbol, if defined, indicates that the sendmsg() function
?C:	is available.
?C:.
?H:#$d_sendmsg HAS_SENDMSG		/**/
?H:.
?LINT:set d_sendmsg
: check for sendmsg function
$cat >try.c <<EOC
#$i_systypes I_SYS_TYPES
#$i_sysselct I_SYS_SELECT
#$i_syssock I_SYS_SOCKET
#$i_winsock2 I_WINSOCK2
#$i_mswsock I_MSWSOCK
#$d_windows WINDOWS_SYSTEM
#ifdef WINDOWS_SYSTEM
#define WINVER 0x0501
#endif
#ifdef I_SYS_TYPES
#include <sys/types.h>
#endif
#ifdef I_SYS_SOCKET
#include <sys/socket.h>
#endif
#ifdef I_WINSOCK2
#include <Winsock2.h>
#endif
#ifdef I_MSWSOCK
#include <Mswsock.h>
#endif
int main(void)
{
	static struct msghdr msg;
	int ret, fd, flags;

	fd = 1;
	flags = 1;
	msg.msg_name = (void *) 0;
	msg.msg_namelen |= 1;
	msg.msg_iov = (void *) 0;
	msg.msg_iovlen |= 1;
	/* msg.msg_flags is intentionally excluded, see other unit */
	msg.msg_control = (void *) 0;
	msg.msg_controllen |= 1;
	ret = sendmsg(fd, &msg, flags);
	return ret ? 0 : 1;
}
EOC
cyn='sendmsg'
set d_sendmsg
eval $trylink