I'm very new to Linux/C.
我对Linux/C很陌生。
In the glibc(eglibs-2.15) sources on my Linux I can only find puts() declaration in /libio/stdio.h
在我的Linux上的glibc(eglibs-2.15)源代码中,我只能在/libio/stdi .h中找到put()声明
extern int puts (__const char *__s);
but cannot find sources for puts() anywhere in glibc sources. My guess is that puts() is system dependent and its sources are somewhere else. Question: where can I find puts() sources?
但是不能在glibc的任何地方找到put()的源代码。我的猜测是put()是依赖于系统的,它的来源在其他地方。问题:我在哪里可以找到put()源?
Also, it looks like on some systems sources for puts() are available, for instance on Apple (http://www.opensource.apple.com/source/Libc/Libc-186/stdio.subproj/puts.c) or NetBSD (https://www-asim.lip6.fr/trac/netbsdtsar/browser/vendor/netbsd/5-20091104/src/lib/libc/stdio/puts.c?rev=160).
此外,在一些系统数据源上,也可以使用put(),例如在Apple上(http://www.opensource.apple.com/source/libc/libc/libc/libc/stdio.subproject/puts.c)或NetBSD (https://www-asim.lip6. fr/trac/netbsdtsar/browser/vendor/netbsd/5/20091104/src/lib/stdio/puts.c?
Why is it so?
为什么如此?
1 个解决方案
#1
3
In glibc, puts is aliased to the _IO_puts function, defined in ./libio/ioputs.c
在glibc中,put被别名为_io_put函数,在./libio/ioputs.c中定义
#1
3
In glibc, puts is aliased to the _IO_puts function, defined in ./libio/ioputs.c
在glibc中,put被别名为_io_put函数,在./libio/ioputs.c中定义