summaryrefslogtreecommitdiff
path: root/mcon/U/d_sockaddr_un.U
blob: c4d5f19b2e3b2c1e528807ed498ffecce5f8dcdf (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
?RCS: $Id: d_sockaddr_in_sin_len.U 57 2010-12-11 23:44:52Z rmanfredi $
?RCS:
?RCS: Copyright (c) 2011, Raphael Manfredi
?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_sockaddr_un: Trylink cat i_arpainet i_syssock i_winsock2 i_niin i_sysun
?MAKE:	-pick add $@ %<
?S:d_sockaddr_un:
?S:	This variable conditionally defines the HAS_SOCKADDR_UN symbol,
?S:	indicates to the C program that struct sockaddr_un is available to
?S:	create file sockets.
?S:.
?C:HAS_SOCKADDR_UN:
?C:	This symbol is defined if struct sockaddr_un exists, allowing the
?C:	creation of file sockets.
?C:.
?H:#$d_sockaddr_un HAS_SOCKADDR_UN
?H:.
?LINT: set d_sockaddr_un
: does struct sockaddr_un exists?
$cat >try.c <<EOC
#$i_syssock I_SYS_SOCKET
#$i_sysun I_SYS_UN
#$i_niin I_NETINET_IN
#$i_winsock2 I_WINSOCK2
#$i_arpainet I_ARPA_INET
#include <sys/types.h>
#ifdef I_SYS_SOCKET
#include <sys/socket.h>
#endif
#ifdef I_SYS_UN
#include <sys/un.h>
#endif
#ifdef I_NETINET_IN
#include <netinet/in.h>
#endif
#ifdef I_ARPA_INET
#include <arpa/inet.h>
#endif
#ifdef I_WINSOCK2
#include <Winsock2.h>
#endif
#if !defined(AF_LOCAL) && defined(AF_UNIX)
#define AF_LOCAL AF_UNIX
#endif
int main(void)
{
	static struct sockaddr_un addr;
	addr.sun_family = AF_LOCAL;
	return 0;
}
EOC
cyn="whether 'struct sockaddr_un' is available"
set d_sockaddr_un
eval $trylink