xref: /onnv-gate/usr/src/uts/common/sys/un.h (revision 12101:d21365a70a85)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57970Spalle@lyckegaard.dk  * Common Development and Distribution License (the "License").
67970Spalle@lyckegaard.dk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12101Sdanmcd@sun.com  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
260Sstevel@tonic-gate /*	  All Rights Reserved  	*/
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
300Sstevel@tonic-gate  * The Regents of the University of California
310Sstevel@tonic-gate  * All Rights Reserved
320Sstevel@tonic-gate  *
330Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
340Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
350Sstevel@tonic-gate  * contributors.
360Sstevel@tonic-gate  */
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #ifndef	_SYS_UN_H
390Sstevel@tonic-gate #define	_SYS_UN_H
400Sstevel@tonic-gate 
410Sstevel@tonic-gate #ifdef	__cplusplus
420Sstevel@tonic-gate extern "C" {
430Sstevel@tonic-gate #endif
440Sstevel@tonic-gate 
450Sstevel@tonic-gate #ifndef _SA_FAMILY_T
460Sstevel@tonic-gate #define	_SA_FAMILY_T
470Sstevel@tonic-gate typedef	unsigned short sa_family_t;
480Sstevel@tonic-gate #endif
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /*
510Sstevel@tonic-gate  * Definitions for UNIX IPC domain.
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate struct	sockaddr_un {
540Sstevel@tonic-gate 	sa_family_t	sun_family;		/* AF_UNIX */
550Sstevel@tonic-gate 	char		sun_path[108];		/* path name (gag) */
560Sstevel@tonic-gate };
570Sstevel@tonic-gate 
588345Sdanmcd@sun.com #if (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
598345Sdanmcd@sun.com     defined(__EXTENSIONS__)
607970Spalle@lyckegaard.dk /*
617970Spalle@lyckegaard.dk  * NOTE: If we ever go to BSD-style sun_len + sun_family, this macro needs to
627970Spalle@lyckegaard.dk  * change.
637970Spalle@lyckegaard.dk  *
648345Sdanmcd@sun.com  * Also, include a strlen() prototype, and we have to protect it w.r.t.
658345Sdanmcd@sun.com  * UNIX{98,03}.  And because there's strlen, we need size_t as well.
667970Spalle@lyckegaard.dk  */
678345Sdanmcd@sun.com #if !defined(_SIZE_T) || __cplusplus >= 199711L
688345Sdanmcd@sun.com #define	_SIZE_T
698345Sdanmcd@sun.com #if defined(_LP64) || defined(_I32LPx)
70*12101Sdanmcd@sun.com typedef	unsigned long	size_t;		/* size of something in bytes */
718345Sdanmcd@sun.com #else
72*12101Sdanmcd@sun.com typedef	unsigned int	size_t;		/* (historical version) */
738345Sdanmcd@sun.com #endif
748345Sdanmcd@sun.com #endif	/* _SIZE_T */
758345Sdanmcd@sun.com 
767970Spalle@lyckegaard.dk extern size_t strlen(const char *);
778345Sdanmcd@sun.com 
787970Spalle@lyckegaard.dk #define	SUN_LEN(su)	(sizeof (sa_family_t) + strlen((su)->sun_path))
797970Spalle@lyckegaard.dk 
808345Sdanmcd@sun.com #endif	/* (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || ... */
818345Sdanmcd@sun.com 
820Sstevel@tonic-gate #ifdef _KERNEL
830Sstevel@tonic-gate int	unp_discard();
840Sstevel@tonic-gate #endif
850Sstevel@tonic-gate 
860Sstevel@tonic-gate #ifdef	__cplusplus
870Sstevel@tonic-gate }
880Sstevel@tonic-gate #endif
890Sstevel@tonic-gate 
900Sstevel@tonic-gate #endif /* _SYS_UN_H */
91