Is the GNU C Library usable on non-GNU (or POSIX)

2020-07-17 16:02发布

Just wondering, is the GNU C Library (glibc) usable on non-GNU and/or non-POSIX platforms such as Microsoft Windows?

2条回答
唯我独甜
2楼-- · 2020-07-17 16:24

Yes, its possible in theory, but not really worth it in practice. You would need to port the syscall interface, dynamic linker, and other parts to Windows or your platform of choice, and Glibc is not an ideal candidate for this.

If you really need a self contained C library, I would consider newlib or uClibc (or FreeBSD's/OpenBSD's libc) over glibc. Glibc is a complex beast, the alternatives are much smaller and easier to understand.

查看更多
迷人小祖宗
3楼-- · 2020-07-17 16:29

It is provided that glibc has been ported to the kernel in question. It may however be easier to use Gnulib instead as a wrapper around the native API.

查看更多
登录 后发表回答