diff --git a/include/zephyr/posix/stropts.h b/include/zephyr/posix/stropts.h index e502d661ab05..9da8f681dc1e 100644 --- a/include/zephyr/posix/stropts.h +++ b/include/zephyr/posix/stropts.h @@ -19,8 +19,8 @@ struct strbuf { int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags); -int putpmsg(int fildes, const struct strbuf *ctlptr, -const struct strbuf *dataptr, int band, int flags); +int putpmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int band, + int flags); #ifdef __cplusplus } diff --git a/lib/posix/options/stropts.c b/lib/posix/options/stropts.c index 98d9fc3f0789..3e7850fd8726 100644 --- a/lib/posix/options/stropts.c +++ b/lib/posix/options/stropts.c @@ -19,8 +19,8 @@ int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr return -1; } -int putpmsg(int fildes, const struct strbuf *ctlptr, -const struct strbuf *dataptr, int band, int flags) +int putpmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int band, + int flags) { ARG_UNUSED(fildes); ARG_UNUSED(ctlptr); diff --git a/tests/posix/common/src/stropts.c b/tests/posix/common/src/stropts.c index 4c9221a398ca..1815de870415 100644 --- a/tests/posix/common/src/stropts.c +++ b/tests/posix/common/src/stropts.c @@ -18,4 +18,17 @@ ZTEST(stropts, test_putmsg) zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); } +ZTEST(stropts, test_putpmsg) +{ + const struct strbuf *ctrl = NULL; + const struct strbuf *data = NULL; + int fd = -1; + int band = 0; + int flags = 0; + int ret = putpmsg(fd, ctrl, data, band, flags); + + zassert_equal(ret, -1, "Expected return value -1, got %d", ret); + zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno); +} + ZTEST_SUITE(stropts, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/posix/headers/src/stropts_h.c b/tests/posix/headers/src/stropts_h.c index a095c83c98cc..19a0a3128c85 100644 --- a/tests/posix/headers/src/stropts_h.c +++ b/tests/posix/headers/src/stropts_h.c @@ -26,3 +26,10 @@ ZTEST(posix_headers, test_stropts_h) zassert_not_equal(RS_HIPRI, ~RS_HIPRI); #endif } + +ZTEST(posix_headers, test_stropts_putpmsg) +{ + #ifdef CONFIG_POSIX_API + zassert_not_null((void *)putpmsg, "putpmsg is null"); + #endif +}