xref: /illumos-gate/usr/src/uts/common/sys/un.h (revision 75f727564c6335968600b22ffc11f9a24318bc14)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5406d6273SPalle Lyckegaard  * Common Development and Distribution License (the "License").
6406d6273SPalle Lyckegaard  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22406d6273SPalle Lyckegaard  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
317c478bd9Sstevel@tonic-gate  * The Regents of the University of California
327c478bd9Sstevel@tonic-gate  * All Rights Reserved
337c478bd9Sstevel@tonic-gate  *
347c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
357c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
367c478bd9Sstevel@tonic-gate  * contributors.
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifndef	_SYS_UN_H
407c478bd9Sstevel@tonic-gate #define	_SYS_UN_H
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
437c478bd9Sstevel@tonic-gate extern "C" {
447c478bd9Sstevel@tonic-gate #endif
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #ifndef _SA_FAMILY_T
477c478bd9Sstevel@tonic-gate #define	_SA_FAMILY_T
487c478bd9Sstevel@tonic-gate typedef	unsigned short sa_family_t;
497c478bd9Sstevel@tonic-gate #endif
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate  * Definitions for UNIX IPC domain.
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate struct	sockaddr_un {
557c478bd9Sstevel@tonic-gate 	sa_family_t	sun_family;		/* AF_UNIX */
567c478bd9Sstevel@tonic-gate 	char		sun_path[108];		/* path name (gag) */
577c478bd9Sstevel@tonic-gate };
587c478bd9Sstevel@tonic-gate 
59*75f72756SDan McDonald #if (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || \
60*75f72756SDan McDonald     defined(__EXTENSIONS__)
61406d6273SPalle Lyckegaard /*
62406d6273SPalle Lyckegaard  * NOTE: If we ever go to BSD-style sun_len + sun_family, this macro needs to
63406d6273SPalle Lyckegaard  * change.
64406d6273SPalle Lyckegaard  *
65*75f72756SDan McDonald  * Also, include a strlen() prototype, and we have to protect it w.r.t.
66*75f72756SDan McDonald  * UNIX{98,03}.  And because there's strlen, we need size_t as well.
67406d6273SPalle Lyckegaard  */
68*75f72756SDan McDonald #if !defined(_SIZE_T) || __cplusplus >= 199711L
69*75f72756SDan McDonald #define	_SIZE_T
70*75f72756SDan McDonald #if defined(_LP64) || defined(_I32LPx)
71*75f72756SDan McDonald typedef	ulong_t	size_t;		/* size of something in bytes */
72*75f72756SDan McDonald #else
73*75f72756SDan McDonald typedef	uint_t	size_t;		/* (historical version) */
74*75f72756SDan McDonald #endif
75*75f72756SDan McDonald #endif	/* _SIZE_T */
76*75f72756SDan McDonald 
77406d6273SPalle Lyckegaard extern size_t strlen(const char *);
78*75f72756SDan McDonald 
79406d6273SPalle Lyckegaard #define	SUN_LEN(su)	(sizeof (sa_family_t) + strlen((su)->sun_path))
80406d6273SPalle Lyckegaard 
81*75f72756SDan McDonald #endif	/* (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || ... */
82*75f72756SDan McDonald 
837c478bd9Sstevel@tonic-gate #ifdef _KERNEL
847c478bd9Sstevel@tonic-gate int	unp_discard();
857c478bd9Sstevel@tonic-gate #endif
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
887c478bd9Sstevel@tonic-gate }
897c478bd9Sstevel@tonic-gate #endif
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate #endif /* _SYS_UN_H */
92