File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed
doc/services/portability/posix/option_groups Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -567,8 +567,8 @@ This table lists service support status in Zephyr for `POSIX_FD_MGMT`:
567
567
flockfile(), yes
568
568
ftrylockfile(), yes
569
569
funlockfile(), yes
570
- getc_unlocked(),
571
- getchar_unlocked(),
570
+ getc_unlocked(), yes :ref: ` †<posix_undefined_behaviour> `
571
+ getchar_unlocked(), yes :ref: ` †<posix_undefined_behaviour> `
572
572
putc_unlocked(), yes
573
573
putchar_unlocked(), yes
574
574
@@ -904,8 +904,8 @@ _POSIX_THREAD_SAFE_FUNCTIONS
904
904
flockfile(), yes
905
905
ftrylockfile(), yes
906
906
funlockfile(), yes
907
- getc_unlocked(),
908
- getchar_unlocked(),
907
+ getc_unlocked(), yes :ref: ` †<posix_undefined_behaviour> `
908
+ getchar_unlocked(), yes :ref: ` †<posix_undefined_behaviour> `
909
909
getgrgid_r(),
910
910
getgrnam_r(),
911
911
getpwnam_r(),
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ int putc_unlocked(int c, FILE *stream);
68
68
int putchar_unlocked (int c );
69
69
#endif /* CONFIG_COMMON_LIBC_PUTC_UNLOCKED || __DOXYGEN__ */
70
70
71
+ #if defined(CONFIG_COMMON_LIBC_GETC_UNLOCKED ) || defined(__DOXYGEN__ )
72
+ int getc_unlocked (FILE * stream );
73
+ int getchar_unlocked (void );
74
+ #endif /* CONFIG_COMMON_LIBC_GETC_UNLOCKED || __DOXYGEN__ */
75
+
71
76
#if defined(CONFIG_POSIX_FILE_LOCKING ) || defined(__DOXYGEN__ )
72
77
void flockfile (FILE * file );
73
78
int ftrylockfile (FILE * file );
Original file line number Diff line number Diff line change 4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
6
6
7
+ #include <errno.h>
7
8
#include <stdio.h>
8
9
9
10
#include <zephyr/sys/libc-hooks.h>
Original file line number Diff line number Diff line change @@ -145,6 +145,24 @@ ZTEST(file_locking, test_stdio)
145
145
z_free_fd (POINTER_TO_INT (file ));
146
146
}
147
147
148
+ /**
149
+ * @brief Existence test for the stubs
150
+ */
151
+ ZTEST (file_locking , test_stubs )
152
+ {
153
+ #ifndef CONFIG_NEWLIB_LIBC
154
+ errno = 0 ;
155
+ zassert_equal (getchar_unlocked (), EOF );
156
+ zassert_equal (errno , ENOSYS );
157
+
158
+ errno = 0 ;
159
+ zassert_equal (getc_unlocked (stdin ), EOF );
160
+ zassert_equal (errno , ENOSYS );
161
+ #else
162
+ ztest_test_skip ();
163
+ #endif /* !CONFIG_NEWLIB_LIBC */
164
+ }
165
+
148
166
#else
149
167
/**
150
168
* PicoLIBC doesn't support these functions in its header
You can’t perform that action at this time.
0 commit comments