diff options
Diffstat (limited to 'src/libPOSIXWrapper/POSIXKit')
| -rw-r--r-- | src/libPOSIXWrapper/POSIXKit/POSIX.h | 24 | ||||
| -rw-r--r-- | src/libPOSIXWrapper/POSIXKit/unistd.h | 17 |
2 files changed, 26 insertions, 15 deletions
diff --git a/src/libPOSIXWrapper/POSIXKit/POSIX.h b/src/libPOSIXWrapper/POSIXKit/POSIX.h new file mode 100644 index 00000000..ea2067b3 --- /dev/null +++ b/src/libPOSIXWrapper/POSIXKit/POSIX.h @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/ne-foss-org/nekernel + +#ifndef LIBPOSIX_POSIXKIT_POSIX_H +#define LIBPOSIX_POSIXKIT_POSIX_H + +#include <libSystem/SystemKit/System.h> + +/// @file POSIX.h +/// @brief POSIX definitions header for the NeSystem. + +/// @brief Please use these macros to specify whether your function is thread safe or not. +#define PTHREAD_UNSAFE __THREAD_UNSAFE +#define PTHREAD_SAFE __THREAD_SAFE + +#define _POSIX_SOURCE __POSIX_SOURCE__ +#define _XOPEN_SOURCE __XOPEN_SOURCE__ + +PTHREAD_UNSAFE IMPORT_C SInt64 write(SizeT count, SInt32 fd, Void* data, SizeT sz); +PTHREAD_UNSAFE IMPORT_C SInt64 read(SizeT count, SInt32 fd, Void* data, SizeT sz); + +#endif // LIBPOSIX_POSIXKIT_POSIX_H diff --git a/src/libPOSIXWrapper/POSIXKit/unistd.h b/src/libPOSIXWrapper/POSIXKit/unistd.h index 0e133c89..96701f35 100644 --- a/src/libPOSIXWrapper/POSIXKit/unistd.h +++ b/src/libPOSIXWrapper/POSIXKit/unistd.h @@ -3,19 +3,6 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/nekernel -#ifndef LIBPOSIX_POSIXKIT_UNISTD_H -#define LIBPOSIX_POSIXKIT_UNISTD_H +#pragma once -#include <libSystem/SystemKit/System.h> - -/// @file Unistd.h -/// @brief POSIX Standard Header for NeKernel. - -#define _POSIX_SOURCE __POSIX_SOURCE__ -#define _XOPEN_SOURCE __XOPEN_SOURCE__ - -IMPORT_C SInt64 write(SizeT count, SInt32 fd, Void* data, SizeT sz); - -IMPORT_C SInt64 read(SizeT count, SInt32 fd, Void* data, SizeT sz); - -#endif // LIBPOSIX_POSIXKIT_UNISTD_H +#include <libPOSIXWrapper/POSIXKit/POSIX.h> |
