What are the most important POSIX functions not available in Android?

后端 未结 4 633
星月不相逢
星月不相逢 2021-01-02 01:20

I\'m about to port a large C++ project (some sort of Library Project, it contains absolutely no GUI) to Android. It\'s actually a Visual C++ project, but it will be ported t

4条回答
  •  -上瘾入骨i
    2021-01-02 02:14

    Bionic Wikipedia page

    https://en.wikipedia.org/wiki/Bionic_(software)#Differences_from_POSIX

    Also has some interesting info:

    Although bionic aims to implement all of C11 and POSIX, there are still (as of Oreo) about 70 POSIX functions missing[8] from libc. There are also POSIX functions such as the endpwent/getpwent/setpwent family that are inapplicable to Android because it lacks a passwd database. As of Oreo, libm is complete.

    Some functions deliberately do not conform to the POSIX or C standards for security reasons, such as printf which does not support the %n format string.[9]

    Official Bionic in tree documentation quote

    https://android.googlesource.com/platform/bionic/+/37ad9597839c70a7ec79578e5072df9c189fc830/docs/status.md

    Run ./libc/tools/check-symbols-glibc.py in bionic/ for the current list of POSIX functions implemented by glibc but not by bionic. Currently (2017-10):

    aio_cancel
    aio_error
    aio_fsync
    aio_read
    aio_return
    aio_suspend
    aio_write
    lio_listio
    pthread_cancel
    pthread_mutex_consistent
    pthread_mutex_getprioceiling
    pthread_mutex_setprioceiling
    pthread_mutexattr_getprioceiling
    pthread_mutexattr_getprotocol
    pthread_mutexattr_getrobust
    pthread_mutexattr_setprioceiling
    pthread_mutexattr_setprotocol
    pthread_mutexattr_setrobust
    pthread_setcancelstate
    pthread_setcanceltype
    pthread_testcancel
    wordexp
    wordfree
    libm
    

    Current libm symbols: https://android.googlesource.com/platform/bionic/+/master/libm/libm.map.txt

    0 remaining missing POSIX libm functions.

提交回复
热议问题