gpt4 book ai didi

c - 是否可以随我的应用程序分发更新版本的 libc?

转载 作者:太空宇宙 更新时间:2023-11-04 04:45:39 24 4
gpt4 key购买 nike

我有一个应用程序需要在各种古老的 Linux 平台上运行,所以我将它链接到 GNU libc 2.1.2。但是目前我正在考虑构建应用程序的 UNICODE 版本。问题是我链接的 libc 没有某些基本功能,例如 vswprintf。

是否可以使用 libc 2.4 并将其与我的应用程序一起提供(作为单独的文件 libc.so.6)?它会违反 GNU libc 许可证吗?

还有其他解决方案吗?也许有一个可用的 vswprintf 函数(我相信编写这个函数的效率不是很高)。到目前为止,我唯一的其他选择是将所有内容转换为 char* 并使用 vsprintf。

最佳答案

听起来很糟糕。古老的平台应该有古老的系统调用,有古老的原型(prototype)。阅读here

The world changes and system calls change. Since one must not break old binaries, the semantics associated to any given system call number must remain fully backwards compatible.

What happens in practice is one of two things: either one gets a new and improved system call with a new name and number, and the libc routine that used to invoke the old call is changed to use the new one, or the new call (with new number) gets the old name, and the old call gets "old" prefixed to its name.

关于c - 是否可以随我的应用程序分发更新版本的 libc?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21190908/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com