xref: /titanic_44/usr/src/lib/libast/common/include/modecanon.h (revision 379c004d1f26b343f034bba8a350290691d00d38)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1985-2008 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                 Glenn Fowler <gsf@research.att.com>                  *
18 *                  David Korn <dgk@research.att.com>                   *
19 *                   Phong Vo <kpv@research.att.com>                    *
20 *                                                                      *
21 ***********************************************************************/
22 #pragma prototyped
23 /*
24  * Glenn Fowler
25  * AT&T Research
26  *
27  * canonical mode_t representation
28  */
29 
30 #ifndef _MODECANON_H
31 #define _MODECANON_H
32 
33 #define X_ITYPE(m)	((m)&X_IFMT)
34 
35 #define	X_IFMT		0170000
36 #define	X_IFWHT		0160000
37 #define	X_IFDOOR	0150000
38 #define	X_IFSOCK	0140000
39 #define	X_IFLNK		0120000
40 #define	X_IFCTG		0110000
41 #define	X_IFREG		0100000
42 #define	X_IFBLK		0060000
43 #define	X_IFDIR		0040000
44 #define	X_IFCHR		0020000
45 #define	X_IFIFO		0010000
46 
47 #define X_IPERM		0007777
48 #define	X_ISUID		0004000
49 #define	X_ISGID		0002000
50 #define	X_ISVTX		0001000
51 #define	X_IRUSR		0000400
52 #define	X_IWUSR		0000200
53 #define	X_IXUSR		0000100
54 #define	X_IRGRP		0000040
55 #define	X_IWGRP		0000020
56 #define	X_IXGRP		0000010
57 #define	X_IROTH		0000004
58 #define	X_IWOTH		0000002
59 #define	X_IXOTH		0000001
60 
61 #define X_IRWXU		(X_IRUSR|X_IWUSR|X_IXUSR)
62 #define X_IRWXG		(X_IRGRP|X_IWGRP|X_IXGRP)
63 #define X_IRWXO		(X_IROTH|X_IWOTH|X_IXOTH)
64 
65 #endif
66