source: trunk/kernel/syscalls/shared_include/shared_dirent.h @ 546

Last change on this file since 546 was 445, checked in by alain, 7 years ago

Restructure the mini_libc.

File size: 1.8 KB
Line 
1/*
2 * shared_dirent.h - Shared structure used by the opendir() / readdir() / closedir() syscalls.
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 _SHARED_DIRENT_H_
25#define _SHARED_DIRENT_H_
26
27/*******************************************************************************************
28 * These two structure defines the informations returned to user by the opendir()
29 * function, used by the readdir() function, and released by the closedir() function.
30 * - "DIR" describes the complete directory.
31 * - "dirent" describes one directory entry.
32 ******************************************************************************************/
33
34#define DIRENT_NAME_MAX_LENGTH  56
35#define DIRENT_MAX_NUMBER       63
36
37struct dirent
38{
39    unsigned int   inum;                                /*! inode identifier              */
40    unsigned int   type;                                /*! inode type                    */
41    char           name[DIRENT_NAME_MAX_LENGTH];        /*! directory entry name          */
42};
43
44typedef struct user_directory
45{
46    struct dirent   entry[DIRENT_MAX_NUMBER];
47    unsigned int    current;
48}
49DIR;
50
51#endif
Note: See TracBrowser for help on using the repository browser.