谁提供了C头文件?

时间:2012-03-23 15:07:30

标签: c linux gcc

我以Ubuntu(Linux)+ gcc为例。

  • stdio.h
  • sys/socket.h
  • poll.h
  • pthread.h
在Ubuntu Linux(安装了gcc)上分别由哪个组织提供? GNU? Linux? ISO? Ubuntu的?

相应的库怎么样?

4 个答案:

答案 0 :(得分:3)

这些是库头,它们是系统上安装的C库的一部分。

在Ubuntu上使用 glibc 实现(GNU C库)。 C库的其他一些例子:
uclibc(嵌入式),avr-libc(嵌入式),dietlibc,klibc,elibc_FreeBSD ......

ISO / IEC创建了标准,这些库遵循它。

~ head -n 20 /usr/include/stdio.h
/* Define ISO C stdio on top of C++ iostreams.
   Copyright (C) 1991, 1994-2010, 2011 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

答案 1 :(得分:1)

Ubuntu由Canonical维护,因此他们是组装软件包的人。

作为C标准库的GNU实现的一部分,标准C库头文件由GNU.org维护,因此这是Canonical从中获取的源代码。

答案 2 :(得分:1)

它们由GNU提供。

/usr/include/stdio.h的第一行:

/* Define ISO C stdio on top of C++ iostreams.
   Copyright (C) 1991, 1994-2008, 2009, 2010 Free Software Foundation, Inc.
   This file is part of the GNU C Library...

答案 3 :(得分:0)

gcc是一个GNU编译器,无论在

上安装什么系统