CentOS 8上的socket.h头在哪里?

问题描述 投票:0回答:1

在Ubuntu 20.04中,我有。

$ dpkg -S /usr/include/x86_64-linux-gnu/sys/socket.h 
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/sys/socket.h

而在CentOS 8的docker容器中,没有任何文件。/usr/include/x86_64-linux-gnu/sys/socket.h 如果我尝试

$ yum whatprovides socket.h
CentOS-8 - AppStream                                                                                                                         1.8 MB/s | 7.0 MB     00:03    
CentOS-8 - Base                                                                                                                              3.3 MB/s | 2.2 MB     00:00    
CentOS-8 - Extras                                                                                                                            8.9 kB/s | 5.5 kB     00:00    
Error: No Matches found

$ rpm -q --whatprovides socket.h
no package provides socket.h
linux centos yum
1个回答
2
投票

你可以把通配符传给 yum whatprovides:

$ yum whatprovides /usr/include/*sys/socket.h
Last metadata expiration check: 0:00:26 ago on Mon 04 May 2020 04:34:26 PM EDT.
glibc-headers-2.30-5.fc31.i686 : Header files for development using standard C libraries.
Repo        : fedora
Matched from:
Filename    : /usr/include/sys/socket.h

glibc-headers-2.30-5.fc31.x86_64 : Header files for development using standard C libraries.
Repo        : fedora
Matched from:
Filename    : /usr/include/sys/socket.h

glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo        : @System
Matched from:
Filename    : /usr/include/sys/socket.h

glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo        : updates
Matched from:
Filename    : /usr/include/sys/socket.h

所以你的答案是 glibc-headers.

© www.soinside.com 2019 - 2024. All rights reserved.