Update MentOs code to the latest development version.

This commit is contained in:
Enrico Fraccaroli
2021-10-04 11:44:02 +02:00
parent 6fd063984a
commit b01eccca2e
484 changed files with 42358 additions and 20285 deletions
+9
View File
@@ -0,0 +1,9 @@
/// @file ioctls.h
/// @brief Input/Output ConTroL (IOCTL) numbers.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#pragma once
#define TCGETS 0x5401U ///< Get the current serial port settings.
#define TCSETS 0x5402U ///< Set the current serial port settings.
+36
View File
@@ -0,0 +1,36 @@
/// MentOS, The Mentoring Operating system project
/// @file stat.h
/// @brief Defines the structure used by the functiosn fstat(), lstat(), and stat().
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#pragma once
#if !defined(__SYS_STAT_H) && !defined(__KERNEL__)
#error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
#include "stddef.h"
#include "time.h"
/// @brief Data structure which contains information about a file.
typedef struct stat_t {
/// ID of device containing file.
dev_t st_dev;
/// File serial number.
ino_t st_ino;
/// Mode of file.
mode_t st_mode;
/// File user id.
uid_t st_uid;
/// File group id.
gid_t st_gid;
/// File Size.
off_t st_size;
/// Time of last access.
time_t st_atime;
/// Time of last data modification.
time_t st_mtime;
/// Time of last status change.
time_t st_ctime;
} stat_t;
+45
View File
@@ -0,0 +1,45 @@
/// MentOS, The Mentoring Operating system project
/// @file termios-struct.h
/// @brief Definition of the `termios` structure.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#pragma once
/// Type for control characters.
typedef unsigned char cc_t;
/// Type for speed.
typedef unsigned int speed_t;
/// Type for flags.
typedef unsigned int tcflag_t;
/// The number of control characters.
#define NCCS 32
/// @brief Stores information about a terminal IOs.
typedef struct termios {
tcflag_t c_iflag; ///< input mode flags
tcflag_t c_oflag; ///< output mode flags
tcflag_t c_cflag; ///< control mode flags
tcflag_t c_lflag; ///< local mode flags
cc_t c_line; ///< line discipline
cc_t c_cc[NCCS]; ///< control characters
speed_t c_ispeed; ///< input speed
speed_t c_ospeed; ///< output speed
} termios;
/// @brief These flags generally control higher-level aspects of input processing than the input
/// modes flags described in Input Modes, such as echoing, signals, and the choice of canonical
/// or noncanonical input.
enum {
ISIG = 000001U, ///< Controls whether the INTR, QUIT, and SUSP characters are recognized.
ICANON = 000002U, ///< Enables canonical input processing mode.
ECHO = 000010U, ///< Echo input characters.
ECHOE = 000020U, ///< If ICANON is set, the ERASE character erases the preceding character.
ECHOK = 000040U, ///< If ICANON is set, the KILL character erases the current line.
ECHONL = 000100U, ///< If ICANON is set, echo the NL character even if ECHO is not set.
NOFLSH = 000200U, ///< Do not clear in/out queues when receiving INTR, QUIT, and SUSP.
TOSTOP = 000400U, ///< Allows SIGTTOU signals generated by background processes.
ECHOCTL = 001000U, ///< If this and ECHO are set, control characters with ^ are echoed.
ECHOKE = 004000U, ///< If ICANON is set, KILL is echoed by erasing each character on the line.
IEXTEN = 100000U, ///< Enables implementation-defined input processing.
};