Page MenuHomeFreeBSD

mbtowc(3): set errno to EILSEQ if an incomplete character is passed.
ClosedPublic

Authored by pfg on Feb 29 2016, 6:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 12 2024, 7:32 AM
Unknown Object (File)
Feb 11 2024, 2:31 AM
Unknown Object (File)
Dec 31 2023, 9:22 AM
Unknown Object (File)
Dec 31 2023, 9:21 AM
Unknown Object (File)
Dec 20 2023, 1:19 AM
Unknown Object (File)
Oct 20 2023, 10:27 AM
Unknown Object (File)
Oct 18 2023, 1:33 PM
Unknown Object (File)
Sep 6 2023, 11:29 AM
Subscribers

Details

Summary

According to POSIX, The mbtowc() function shall fail if:
[EILSEQ] An invalid character sequence is detected.

Obtained from: OpenBSD (Ingo Schwarze)

Test Plan

The related test from kyua consistently shows an expected failure.
...
20160301-031439 I 58919 utils/cmdline/ui.cpp:103: stdout: lib/libc/locale/mbtowc_test:mbtowc ->
20160301-031439 I 58919 engine/scheduler.cpp:1084: Spawning /usr/tests/lib/libc/locale/mbtowc_test:mbtowc
20160301-031439 I 58919 utils/process/executor.cpp:774: Spawned subprocess with exec_handle 87696
20160301-031439 I 58919 utils/process/executor.cpp:630: Waited for subprocess with exec_handle 87696
20160301-031439 I 58919 utils/process/executor.cpp:368: Cleaning up exit_handle for exec_handle 87696
20160301-031439 I 58919 utils/cmdline/ui.cpp:103: stdout: expected_failure: zh_CN.GB18030: /usr/src/contrib/netbsd-tests/lib/libc/locale/t_mbtowc.c:122: ret != (size_t)-1 not met [0.004s]
...

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2705
Build 2725: arc lint + arc unit

Event Timeline

pfg retitled this revision from to mbtowc(3): set errno to EILSEQ if an incomplete character is passed..
pfg updated this object.
pfg edited the test plan for this revision. (Show Details)
pfg added reviewers: jilles, bapt, theraven.
bapt edited edge metadata.

Looks good to me have you checked that it does not break the test suite? I remember that some tests were failing after I did some of those changes (and I needed to fix those tests)

This revision is now accepted and ready to land.Feb 29 2016, 7:31 PM
In D5496#117148, @bapt wrote:

Looks good to me have you checked that it does not break the test suite? I remember that some tests were failing after I did some of those changes (and I needed to fix those tests)

Interesting. Thanks for the feedback.
It would be really surprising if this would cause an error on the testsuite .. will check :).

pfg edited edge metadata.