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
+15
View File
@@ -0,0 +1,15 @@
/// MentOS, The Mentoring Operating system project
/// @file errno.c
/// @brief Stores the error number.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include "sys/errno.h"
/// @brief Returns the error number for the current process.
/// @return Pointer to the error number.
int *__geterrno()
{
static int _errno = 0;
return &_errno;
}
+11
View File
@@ -0,0 +1,11 @@
/// MentOS, The Mentoring Operating system project
/// @file ioctl.c
/// @brief Input/Output ConTroL (IOCTL) functions implementation.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include "sys/ioctl.h"
#include "sys/errno.h"
#include "system/syscall_types.h"
_syscall3(int, ioctl, int, fd, unsigned long int, request, void *, data)
+37
View File
@@ -0,0 +1,37 @@
/// MentOS, The Mentoring Operating system project
/// @file unistd.c
/// @brief Functions used to manage files.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include "sys/unistd.h"
#include "string.h"
#include "limits.h"
#include "stdio.h"
#if 0
#include "vfs.h"
int rmdir(const char *path)
{
char absolute_path[PATH_MAX];
get_absolute_normalized_path(path, absolute_path);
int32_t mp_id = get_mountpoint_id(absolute_path);
if (mp_id < 0) {
printf("rmdir: failed to remove '%s':"
"Cannot find mount-point\n",
path);
return -1;
}
if (mountpoint_list[mp_id].dir_op.rmdir_f == NULL) {
return -1;
}
return mountpoint_list[mp_id].dir_op.rmdir_f(absolute_path);
}
#endif
+12
View File
@@ -0,0 +1,12 @@
/// MentOS, The Mentoring Operating system project
/// @file utsname.c
/// @brief Functions used to provide information about the machine & OS.
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include "sys/utsname.h"
#include "system/syscall_types.h"
#include "sys/errno.h"
#include "stddef.h"
_syscall1(int, uname, utsname_t *, buf)