我是靠谱客的博主 暴躁秀发,最近开发中收集的这篇文章主要介绍【翻译】(19)Bionic Changes,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

-----------------

英文文档见android-ndk-r7的documentation.html

属于Android Native Development Kit (NDK)的一部分

http://developer.android.com/sdk/ndk/index.html

翻译仅个人见解

-----------------

 

Bionic ChangeLog:

-----------------

 

Bionic修改日志:

-----------------

 

Differences between current and Android 2.1:

 

当前版本与Android 2.1之间的差异:

 

- Add support for SH-4 CPU architecture !

 

- 添加对SH-4 CPU架构的支持!(注:SH是SuperH的缩写,以32位元存取的精简指令集架构,由日立开始开发)

 

- __atomic_swap(): use LDREX/STREX CPU instructions on ARMv6 and higher.

 

- __atomic_swap():ARMv6或更高的CPU上使用LDREX/STREX CPU指令。

 

- <arpa/telnet.h>: New header (declarations only, no implementation).

 

- <arpa/telnet.h>:新的头文件(只有声明,没有实现)。

 

- <err.h>: New header + implementation. GLibc compatibility.

 

- <err.h>:新的头文件+实现。兼容GLibc。

 

- <warn.h>: New header + implementation. GLibc compatibility.

 

- <warn.h>:新的头文件+实现。兼容GLibc。

 

- <fts.h>: New header + implementation.

 

- <fts.h>:新的头文件+实现。

 

- <mntent.h>: Add missing <stdio.h> include.

 

- <mntent.h>:添加缺少的<stdio.h>包含。

 

- <regex.h>: New header + implementation.

 

- <regex.h>:新的头文件+实现。

 

- <signal.h>: Added killpg()

 

- <signal.h>:添加killpg()(注:killpg在Linux上用于发送信号给进程组)

 

- <stdint.h>: Allow 64-bit type declarations on C99 builds.

 

- <stdint.h>:允许在C99构建上使用64位类型声明。

 

- <stdio.h>: Add fdprintf() and vfdprintf(). Note that GLibc provides the confusing 'dprintf' and 'vdprintf()' functions instead.

 

- <stdio.h>:添加fdprintf()和vfdprintf()(注:这两个函数在Linux上用于对文件描述符printf)。注意,与GLibc提供混淆的'dprintf'和'vdprintf()'函数不同。

 

- <stdlib.h>: Fix ptsname_r(): the return type is int instead of char*. The mistake comes from a GLibc man page bug (the man page listed a return type of char*, while the implementation used int. Fixed in late 2009 only). The Bionic implementation was incorrect. Technically, this is an ABI breakage, but code that used this function probably never worked or compiled properly anyway.

 

- <stdlib.h>:修正ptsname_r():返回类型是int而非char*。这个错误来自GLibc手册页面的缺陷(手册页面列出返回值为char*,但实现使用int。只在2009年底修正)。Bionic实现是不正确的。技术上,这是一个ABI破损,但使用这个函数的代码很可能无论如何都不能工作或正确地编译。

 

- <strings.h>: Add missing <sys/types.h> include.

 

- <strings.h>:添加缺少的<sys/types.h>包含。

 

- <sys/queue.h>: Added new header (no implementation - macro templates).

 

- <sys/queue.h>:添加新的头文件(没有实现——宏模板)。

 

- <sys/resource.h>: Add rlim_t proper definition.

 

- <sys/resource.h>:添加rlim_t的正确定义。(注:用于表示限制值的无符号整数类型)

 

- <time64.h>: Add missing C++ header inclusion guards.

 

- <time64.h>:添加缺少的C++头文件包含保护。

 

- <unistd.h>: Add getusershell(), setusershell() and endusershell(), though implementation are bogus. GLibc compatibility.

 

- <unistd.h>:添加getusershell(),setusershell()和endusershell(),虽然实现是假的。(注:这三个函数在Linux下用于获取合法的用户外壳命令,读取/etc/shells文件的下一行)。兼容GLibc。

 

- <wchar.h>: Add mbstowcs() and wcstombs()

 

- <wchar.h>:添加mbstowcs()和wcstombs()(注:在多字节和宽字节之间转换)

 

- add clone() implementation for ARM (x86 and SH-4 not working yet).

 

- 为ARM添加clone()实现(x86和SH-4还不能工作)。

 

- <sys/epoll.h>: <sys/system_properties.h>: Add missing C++ inclusion guards

 

- <sys/epoll.h>:<sys/system_properties.h>:添加缺少的C++包含保护。

 

- fix getpwnam() and getpwgrp() to accept "app_0" as a valid user name.

 

- 修正getpwnam()(注:通过用户名获取用户属性)和getpwgrp()(注:获取调用进程的进程组ID)以接受"app_0"作为合法用户名。

 

- fix sem_trywait() to return -1 and set errno to EAGAIN, instead of returning EAGAIN directly.

 

- 修正sem_trywait()以返回-1并设置errno为EAGAIN,而非直接返回EAGAIN。

 

- fix sem_post() to wake up multiple threads when called rapidly in succession.

 

- 修正sem_post()以在成功地快速调用时唤醒多个线程。

 

- DNS: partial implementation of RFC3484 (rule 1, 2, 5, 6, 8, 10 and modified rule 9), for better address selection/sorting. In the process, removed code that was previously used for "sortlist" in /etc/resolv.conf. (resolv.conf is already ignored, so the latter is a no-op for actual functionality.)

 

- DNS:部分实现RFC3484(规则1,2,5,6,8,10和修改过的规则9),更好的地址选择/排序。在进程中,移除以前在/etc/resolv.conf中用于sortlist的代码。(resolv.conf已经被忽略,所以以后对于实际功能是无操作的。)

 

- fix pthread_sigmask() to properly return an error code without touching errno. Previous implementation returned -1 on error, setting errno, which is not Posix compliant.

 

- 修正pthread_sigmask()以正确地返回错误码而不影响errno。以前的实现在出错时返回-1,设置errno,这是不兼容Posix的(注:Posix是Unix可移植操作系统接口的缩写)。

 

- add sigaltstack() implementation for ARM.

 

- 添加ARM的sigaltstack()实现。(注:设置或获取信号备用堆栈上下文)

 

- <time.h>: Properly implement the 'timezone' and 'daylight' global variables (they were not defined previously, though declared in the header).

 

- <time.h>:正确实现timezone和daylight全局变量(它们之前没有定义,虽然在头文件中声明了)

 

- <time.h>: Fix timezone management implementation to properly update 'tm_gmtoff' field in 'struct tm' structure.

 

- <time.h>:修正时区管理实现以正确地更新struct tm结构体中的tm_gmtoff域。

 

- DNS: get rid of spurious random DNS queries when trying to resolve an unknown domain name. Due to an initialization bug, a random DNS search list was generated for each thread if net.dns.search is not defined.

 

- DNS:避免当尝试解析一个未知域名时的伪随机DNS查询。因为一个初始化的缺陷,如果net.dns.search未定义,每个线程将生成一个随机DNS搜索列表。

 

- <pthread.h>: Add pthread_condattr_init/destroy/setpshared/getpshared functions to enable proper shared conditional variable initialization.

 

- <pthread.h>:添加pthread_condattr_init/destroy/setpshared/getpshared函数,使正确的共享条件变量初始化生效。

 

  Modify the pthread_mutex_t and pthread_cond_t implementation to use private futexes for performance reasons. Mutexes and Condvars are no longer shareable between processes by default anymore, unless you use PTHREAD_PROCESS_SHARED with pthread_mutexattr_setpshared() and/or pthread_condattr_setpshared().

 

  修改pthread_mutex_t和pthread_cond_t实现以使用私有futex,出于性能原因。默认下mutex和condvar不再在进程间共享,除非你上用pthread_mutexattr_setpshared()和/或pthread_condattr_setpshared()指定PTHREAD_PROCESS_SHARED。

 

-------------------------------------------------------------------------------

Differences between Android 2.1 and 2.0.1:

 

Android 2.1和2.0.1之间的差异:

 

- zoneinfo: updated data tables to version 2009s

 

- zoneinfo:更新数据表格至版本2009。

 

-------------------------------------------------------------------------------

Differences between Android 2.0.1 and 2.0:

 

Android 2.0.1和2.0之间的差异:

 

- abort(): ARM-specific hack to preserve the 'lr' register when abort() is called (GCC does not preserve it by default since it thinks that abort() never returns). This improves stack traces considerably.

 

- abort():特定ARM的修改,以在abort()调用时保留lr寄存器(GCC默认不保留它,因为它认为abort()从不返回)。这很大程度上改进了堆栈追溯。

 

-------------------------------------------------------------------------------

Differences between Android 2.0 and 1.6:

 

Android 2.0和1.6之间的差异:

 

- memcmp(), memcpy(): ARMv7 optimized versions.

 

- memcmp(),memcpy():ARMv7优化版本。(注:memcmp用于比较内存区,memcpy用于复制内存)

 

- pthread_mutexattr_setpshared(): implementation will not return ENOTSUP if PTHREAD_PROCESS_SHARED is used, because our Mutex implementation can work across multiple processes.

 

- pthread_mutexattr_setpshared:如果使用了PTHREAD_PROCESS_SHARED,实现将不会返回ENOTSUP,因为我们的互斥锁实现可以跨多个进程工作。(注:pthread_mutexattr_setpshared用于设置特定互斥属性值的进程共享状态属性,PTHREAD_PROCESS_SHARED表示创建的互斥量可以在系统内的所有进程中同步线程,而不局限于当前进程)

 

  *HOWEVER* it does not use "robust futexes" which means that held mutexes *are not* automatically released by the kernel when the owner process crashes or exits. This is only done to simplify communication between two always-live system processes, DO NOT USE THIS IN APPLICATIONS !

 

  然而它不使用robust futex(注:健壮的快速用户互斥锁,见http://lxr.linux.no/linux/Documentation/robust-futexes.txt),它的意思是内核持有拥有者进程崩溃或退出时不被自动释放的mutex。这个函数只用来简化两个已存在系统进程间的通信,不要在应用程序中使用它!

 

- pthread_mutex_lock_timeout_np(): New Android-specific function to perform a timed lock(). In case of timeout, it returns EBUSY.

 

- pthread_mutex_lock_timeout_np():新的特定Android的函数以执行超时lock()。在超时的情况下,它返回EBUSY。

 

- pthread_cond_timedwait_monotonic_np(): Same as pthread_cond_timedwait() but uses the monotonic clock(). Android-specific.

 

- pthread_cond_timedwait_monotonic_np():同pthread_cond_timedwait(),但使用单调的clock()。特定于Android。

 

- pthread_cond_timedwait_relative_np(): Same as pthread_cond_timedwait() but uses a relative timeout instead. Android-specific.

 

- pthread_cond_timedwait_relative_np():同pthread_cond_timedwait(),但改为使用相对超时时间。特定于Android。

 

- <netinet/in.h>: Now includes <netinet/in6.h>.

 

- <netinet/in.h>:现在包含<netinet/in6.h>。

 

- <netinet/in6.h>: Added IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, IN6ADDR_ANY_INIT and ipv6mr_interface definitions.

 

- <netinet/in6.h>:添加IPV6_JOIN_GROUP,IPV6_LEAVE_GROUP,IN6ADDR_ANY_INIT和ipv6mr_interface定义。

 

- <time.h>:

    * Add missing tzset() declaration.

    * Add Android-specific strftime_tz().

 

- <time.h>:

* 添加缺少的tzset()定义。(注:设置时间环境变量)

* 添加特定Android的strftime_tz()。

 

- getaddrinfo():

    Only perform IPv6 lookup for AF_UNSPEC if we have IPv6 connectivity. This saves one DNS query per lookup on non-IPv6 systems.

 

- getaddrinfo():

如果我们有IPv6连接,对于AF_UNSPEC参数只执行IPv6查找。它在非IPv6系统上每查找一次,保存一个DNS查询。

 

- mktime(): Fix an infinite loop problem that appeared when switching to GCC 4.4.0.

 

- mktime():修正在切换到GCC 4.4.0时出现的一个无限循环问题。

 

- strftime(): fix incorrect handling of dates > 2038 due to 64-bit issue in original code.

 

- strftime():修正由于原始代码中64位问题造成的大于2038的不正确日期处理。

 

-------------------------------------------------------------------------------

Differences between Android 1.6 and 1.5:

 

Android 1.6和1.5之间的差异:

 

- C runtime: Fix runtime initialization to be called before any static C++ constructors. This allows these to use pthread functions properly.

 

- C运行时:修正运行时的初始化在任意静态C++构造函数(注:这里指静态变量的构造?)调用前被调用。它允许这些构造函数正确地使用pthread函数。

 

- __aeabi_atexit(): Fix implementation to properly call C++ static destructors when the program exits (or when a shared library is unloaded).

 

- __aeabi_atexit():修正实现,使程序退出时(或当一个共享库卸载时)能正确调用C++静态析构函数。

 

- <sys/stat.h>: added GLibc compatibility macros definitions:

 

- <sys/stat.h>:添加兼容GLibc的宏定义:

 

        #define  st_atimensec  st_atime_nsec

        #define  st_mtimensec  st_mtime_nsec

        #define  st_ctimensec  st_ctime_nsec

 

- getaddrinfo(): implementation will now allow numeric ports if ai_socktype is set to ANY. This is to match the GLibc behaviour.

 

- getaddrinfo():实现现在将允许,如果ai_socktype被设置为ANY,则允许数字型的端口。(注:这个函数把DNS主机名转换为IP地址)。这匹配GLibc的行为。

 

- getservent(): and getservent_r() incorrectly returned the port in host-endian order in the s_port field. It now returns it in big-endian order.

 

- getservent():和getservent_r()在s_port域中以不正确的主机字节序返回端口。它现在以大端顺序返回。(注:大端序又被称为网络字节序,用于网络传输)

 

- DNS: Allow underscore in the middle of DNS labels. While not really standard, this extension is needed for some VPN configurations and is supported by other operating systems.

 

- DNS:允许在DNS标签中间带下划线。然而不是太标准,这个扩展是一些VPN(注:虚拟专用网络的缩写)配置所需的,并被其它操作系统支持。

 

- DNS: Support for DNS domain search lists through the new net.dns.search system property. The corresponding value must be a space-separated list of domain suffixes.

 

- DNS:支持通过新的net.dns.search系统属性指定DNS域名搜索列表。相应的值必须是空格分隔的域名后缀列表。


最后

以上就是暴躁秀发为你收集整理的【翻译】(19)Bionic Changes的全部内容,希望文章能够帮你解决【翻译】(19)Bionic Changes所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(48)

评论列表共有 0 条评论

立即
投稿
返回
顶部