xref: /illumos-gate/usr/src/lib/libc/port/rt/pos4obj.h (revision b70bf3ee79d81df3ccc36e553e0ff11049a2b51a)
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 /*
31  * pos4obj.h - Header file for POSIX.4 related object names
32  */
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /* flags used to indicate current state of open */
39 #define	DFILE_CREATE	0x01
40 #define	DFILE_OPEN	0x02
41 #define	ALLOC_MEM	0x04
42 #define	DFILE_MMAP	0x08
43 #define	PFILE_CREATE	0x10
44 #define	NFILE_CREATE	0x20
45 #define	MQDNP_MMAP	0x40
46 
47 /* semaphore object types - used in constructing file name */
48 #define	SEM_DATA_TYPE	".SEMD"
49 #define	SEM_LOCK_TYPE	".SEML"
50 
51 /* message queue object types - used in constructing file name */
52 #define	MQ_DATA_TYPE	".MQD"
53 #define	MQ_PERM_TYPE	".MQP"
54 #define	MQ_DSCN_TYPE	".MQN"
55 #define	MQ_LOCK_TYPE	".MQL"
56 
57 /* shared memory object types - used in constructing file name */
58 #define	SHM_DATA_TYPE	".SHMD"
59 #define	SHM_LOCK_TYPE	".SHML"
60 
61 /* functions defined related to object names in POSIX.4 */
62 extern	int	__pos4obj_lock(const char *, const char *);
63 extern	int	__pos4obj_unlock(const char *, const char *);
64 extern	int	__pos4obj_unlink(const char *, const char *);
65 extern	int	__pos4obj_open(const char *, char *, int, mode_t, int *);
66 extern	int	__pos4obj_check(const char *);
67 
68 /* non-cancelable file operations */
69 int	__open_nc(const char *, int, mode_t);
70 int	__close_nc(int);
71 
72 #ifdef	__cplusplus
73 }
74 #endif
75 
76 #endif	/* _POS4OBJ_H */
77