Skip to content

Commit 1e92152

Browse files
committed
posix: putmsg implementation and configurations
Add needed KConfig, CMakeList and Stropts.c Signed-off-by: Abhinav Srivastava <[email protected]>
1 parent 601c434 commit 1e92152

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

lib/posix/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ zephyr_library_sources_ifdef(CONFIG_PTHREAD_RWLOCK rwlock.c)
5757
zephyr_library_sources_ifdef(CONFIG_POSIX_PRIORITY_SCHEDULING sched.c)
5858
zephyr_library_sources_ifdef(CONFIG_PTHREAD_IPC semaphore.c)
5959
zephyr_library_sources_ifdef(CONFIG_PTHREAD_SPINLOCK spinlock.c)
60-
zephyr_library_sources_ifdef(CONFIG_TIMER timer.c)
60+
zephyr_library_sources_ifdef(CONFIG_POSIX_PUTMSG stropts.c)
6161

6262
zephyr_library_include_directories(
6363
${ZEPHYR_BASE}/kernel/include

lib/posix/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ source "lib/posix/Kconfig.signal"
5858
source "lib/posix/Kconfig.spinlock"
5959
source "lib/posix/Kconfig.timer"
6060
source "lib/posix/Kconfig.uname"
61+
source "lib/posix/Kconfig.stropts"
6162

6263
rsource "shell/Kconfig"
6364

lib/posix/Kconfig.stropts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# copyright (c) 2024 Abhinav Srivastava
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
config POSIX_PUTMSG
6+
bool "Support for putmsg function"
7+
default y if POSIX_API
8+
help
9+
This option provides support for the putmsg function used in message passing.

lib/posix/stropts.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2024 Abhinav Srivastava
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/posix/stropts.h>
8+
#include <errno.h>
9+
#include <zephyr/kernel.h>
10+
11+
int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags)
12+
{
13+
ARG_UNUSED(fildes);
14+
ARG_UNUSED(ctlptr);
15+
ARG_UNUSED(dataptr);
16+
ARG_UNUSED(flags);
17+
18+
errno = ENOSYS;
19+
return -1;
20+
}

0 commit comments

Comments
 (0)