Fix missing backslash in last change.
[glibc.git] / sysdeps / unix / sysv / linux / sa_len.c
blobac2372f554c75c130abe413b415fcb16ba1dd22b
1 /* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #include <sys/socket.h>
21 #include <netash/ash.h>
22 #include <netatalk/at.h>
23 #include <netax25/ax25.h>
24 #include <neteconet/ec.h>
25 #include <netinet/in.h>
26 #include <netipx/ipx.h>
27 #include <netpacket/packet.h>
28 #include <netrose/rose.h>
29 #include <sys/un.h>
31 int
32 __libc_sa_len (sa_family_t af)
34 switch (af)
36 case AF_APPLETALK:
37 return sizeof (struct sockaddr_at);
38 case AF_ASH:
39 return sizeof (struct sockaddr_ash);
40 case AF_AX25:
41 return sizeof (struct sockaddr_ax25);
42 case AF_ECONET:
43 return sizeof (struct sockaddr_ec);
44 case AF_INET:
45 return sizeof (struct sockaddr_in);
46 case AF_INET6:
47 return sizeof (struct sockaddr_in6);
48 case AF_IPX:
49 return sizeof (struct sockaddr_ipx);
50 case AF_LOCAL:
51 return sizeof (struct sockaddr_un);
52 case AF_PACKET:
53 return sizeof (struct sockaddr_ll);
54 case AF_ROSE:
55 return sizeof (struct sockaddr_rose);
57 return 0;