1 | /* |
---|
2 | * stat.h - User side file stat related syscalls definition. |
---|
3 | * |
---|
4 | * Author Alain Greiner (2016,2017,2018) |
---|
5 | * |
---|
6 | * Copyright (c) UPMC Sorbonne Universites |
---|
7 | * |
---|
8 | * This file is part of ALMOS-MKH. |
---|
9 | * |
---|
10 | * ALMOS-MKH is free software; you can redistribute it and/or modify it |
---|
11 | * under the terms of the GNU General Public License as published by |
---|
12 | * the Free Software Foundation; version 2.0 of the License. |
---|
13 | * |
---|
14 | * ALMOS-MKH is distributed in the hope that it will be useful, but |
---|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | * General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with ALMOS-MKH; if not, write to the Free Software Foundation, |
---|
21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _STAT_H_ |
---|
25 | #define _STAT_H_ |
---|
26 | |
---|
27 | /***************************************************************************************** |
---|
28 | * This file defines the stat related library. |
---|
29 | * All these functions make a system call to access kernel structures. |
---|
30 | * The user/kernel shared structures and mnemonics are defined in |
---|
31 | * the <syscalls/shared_include/shared_stat.h> file. |
---|
32 | ****************************************************************************************/ |
---|
33 | |
---|
34 | #include <shared_stat.h> |
---|
35 | |
---|
36 | /***************************************************************************************** |
---|
37 | * This function creates a new directory in file system. |
---|
38 | ***************************************************************************************** |
---|
39 | * @ pathname : pathname (can be relative or absolute). |
---|
40 | * @ mode : access rights (as defined in chmod). |
---|
41 | * @ return 0 if success / returns -1 if failure. |
---|
42 | ****************************************************************************************/ |
---|
43 | int mkdir( const char * pathname, |
---|
44 | int mode ); |
---|
45 | |
---|
46 | /***************************************************************************************** |
---|
47 | * This function creates a named FIFO file in the calling thread cluster. |
---|
48 | * The associated read and write file descriptors mut be be explicitely created |
---|
49 | * using the open() system call. |
---|
50 | ***************************************************************************************** |
---|
51 | * @ pathname : pathname (can be relative or absolute). |
---|
52 | * @ mode : access rights (as defined in chmod). |
---|
53 | * @ return 0 if success / returns -1 if failure. |
---|
54 | ****************************************************************************************/ |
---|
55 | int mkfifo( const char * pathname, |
---|
56 | int mode ); |
---|
57 | |
---|
58 | /***************************************************************************************** |
---|
59 | * This function change the acces rights for the file/dir identified by the |
---|
60 | * pathname argument. |
---|
61 | ***************************************************************************************** |
---|
62 | * @ pathname : pathname (can be relative or absolute). |
---|
63 | * @ rights : acces rights. |
---|
64 | * @ return 0 if success / returns -1 if failure. |
---|
65 | ****************************************************************************************/ |
---|
66 | int chmod( char * pathname, |
---|
67 | unsigned int rights ); |
---|
68 | |
---|
69 | /***************************************************************************************** |
---|
70 | * This function returns in the <stat> structure, defined in the "shared_syscalls.h" |
---|
71 | * file, various informations on the file/directory identified by the <pathname> argument. |
---|
72 | ***************************************************************************************** |
---|
73 | * @ pathname : user pointer on file pathname. |
---|
74 | * @ stat : user pointer on the stat structure. |
---|
75 | * @ returns O if success / returns -1 if failure. |
---|
76 | ****************************************************************************************/ |
---|
77 | int stat( const char * pathname, |
---|
78 | struct stat * stat ); |
---|
79 | |
---|
80 | #endif /* _SYS_STAT_H_ */ |
---|