Porting to OS/2: Case #24 scandir() and alphsort()
scandir() scans a directory, and alphsort() is provided to scandir() as a comparison function to sort directory entries into alphabetical order.
OS/2 kLIBC has a declaration for scandir(), but has not implemented it. In case of alphsort(), OS/2 kLIBC has no even the declaration for it.
Here is the implementation and a test for them.
This implementation follows OS/2 kLIBC declaration. However, notice that OS/2 kLIBC declaration is slightly different from POSIX specs. See the comments for details.
OS/2 kLIBC has a declaration for scandir(), but has not implemented it. In case of alphsort(), OS/2 kLIBC has no even the declaration for it.
Here is the implementation and a test for them.
- source: https://github.com/komh/os2compat/blob/master/io/scandir.c
- header: https://github.com/komh/os2compat/blob/master/io/scandir.h
- test: https://github.com/komh/os2compat/blob/master/testcase/scandir-1.c
This implementation follows OS/2 kLIBC declaration. However, notice that OS/2 kLIBC declaration is slightly different from POSIX specs. See the comments for details.
댓글
댓글 쓰기