Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/*
22
 * Copyright (C) 1999 Massimiliano Giorgi
23
 *
24
 * This program is free software; you can redistribute it and/or modify
25
 * it under the terms of the GNU General Public License as published by
26
 * the Free Software Foundation; either version 2 of the License, or
27
 * (at your option) any later version.
28
 *
29
 * This program is distributed in the hope that it will be useful,
30
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
 * GNU General Public License for more details.
33
 *
34
 * You should have received a copy of the GNU General Public License
35
 * along with this program; if not, write to the Free Software
36
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37
 *
38
 */
39
 
40
/*
41
 * CVS :        $Id: stat.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
42
 *
43
 * File:        $File$
44
 * Revision:    $Revision: 1.1.1.1 $
45
 * Last update: $Date: 2002-03-29 14:12:51 $
46
 */
47
 
48
#ifndef __FS_STAT_H
49
#define __FS_STAT_H
50
 
51
#include <fs/types.h>
52
 
53
#define _SYS_STAT_H
54
#include <bits/stat.h>
55
 
56
#define __S_BLKSIZE   512       /* Block size for `st_blocks'.  */
57
 
58
/*
59
 * test file type macros
60
 */
61
 
62
#define __S_ISTYPE(mode, mask)  (((mode) & __S_IFMT) == (mask))
63
 
64
#define __S_ISDIR(mode)  __S_ISTYPE((mode), __S_IFDIR)
65
#define __S_ISCHR(mode)  __S_ISTYPE((mode), __S_IFCHR)
66
#define __S_ISBLK(mode)  __S_ISTYPE((mode), __S_IFBLK)
67
#define __S_ISREG(mode)  __S_ISTYPE((mode), __S_IFREG)
68
/* the following can be undefined */
69
#define __S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
70
#define __S_ISLNK(mode)  __S_ISTYPE((mode), __S_IFLNK)
71
#define __S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
72
 
73
/*
74
 * files permission
75
 */
76
 
77
#define __S_IRUSR       __S_IREAD               /* Read by owner.  */
78
#define __S_IWUSR       __S_IWRITE              /* Write by owner.  */
79
#define __S_IXUSR       __S_IEXEC               /* Execute by owner.  */
80
#define __S_IRWXU       (__S_IREAD|__S_IWRITE|__S_IEXEC)
81
 
82
#define __S_IRGRP       (__S_IRUSR >> 3)        /* Read by group.  */
83
#define __S_IWGRP       (__S_IWUSR >> 3)        /* Write by group.  */
84
#define __S_IXGRP       (__S_IXUSR >> 3)        /* Execute by group.  */
85
#define __S_IRWXG       (__S_IRWXU >> 3)
86
 
87
#define __S_IROTH       (__S_IRGRP >> 3)        /* Read by others.  */
88
#define __S_IWOTH       (__S_IWGRP >> 3)        /* Write by others.  */
89
#define __S_IXOTH       (__S_IXGRP >> 3)        /* Execute by others.  */
90
#define __S_IRWXO       (__S_IRWXG >> 3)
91
 
92
/*  0777 */
93
#define __ACCESSPERMS (__S_IRWXU|__S_IRWXG|__S_IRWXO)
94
/* 07777 */
95
#define __ALLPERMS    (__S_ISUID|__S_ISGID|__S_ISVTX|\
96
                       __S_IRWXU|__S_IRWXG|__S_IRWXO)
97
/*  0666 */
98
#define __DEFFILEMODE (__S_IRUSR|__S_IWUSR|__S_IRGRP|\
99
                       __S_IWGRP|__S_IROTH|__S_IWOTH)
100
 
101
#define __DEFUMASK    (~(__DEFFILEMODE))
102
 
103
#endif