xref: /illumos-gate/usr/src/lib/libc/port/rt/pos4obj.h (revision 440a8a36792bdf9ef51639066aab0b7771ffcab8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_POS4OBJ_H
28 #define	_POS4OBJ_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * pos4obj.h - Header file for POSIX.4 related object names
34  */
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /* flags used to indicate current state of open */
41 #define	DFILE_CREATE	0x01
42 #define	DFILE_OPEN	0x02
43 #define	ALLOC_MEM	0x04
44 #define	DFILE_MMAP	0x08
45 #define	PFILE_CREATE	0x10
46 #define	NFILE_CREATE	0x20
47 #define	MQDNP_MMAP	0x40
48 
49 /* semaphore object types - used in constructing file name */
50 #define	SEM_DATA_TYPE	".SEMD"
51 #define	SEM_LOCK_TYPE	".SEML"
52 
53 /* message queue object types - used in constructing file name */
54 #define	MQ_DATA_TYPE	".MQD"
55 #define	MQ_PERM_TYPE	".MQP"
56 #define	MQ_DSCN_TYPE	".MQN"
57 #define	MQ_LOCK_TYPE	".MQL"
58 
59 /* shared memory object types - used in constructing file name */
60 #define	SHM_DATA_TYPE	".SHMD"
61 #define	SHM_LOCK_TYPE	".SHML"
62 
63 /* functions defined related to object names in POSIX.4 */
64 extern	int	__pos4obj_lock(const char *, const char *);
65 extern	int	__pos4obj_unlock(const char *, const char *);
66 extern	int	__pos4obj_unlink(const char *, const char *);
67 extern	int	__pos4obj_open(const char *, char *, int, mode_t, int *);
68 extern	int	__pos4obj_check(const char *);
69 
70 /* non-cancelable file operations */
71 int	__open_nc(const char *, int, mode_t);
72 int	__close_nc(int);
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 
78 #endif	/* _POS4OBJ_H */
79