在 Debian 中,opendir 并不是 Debian 某个“版本专属”的特性,而是 POSIX / C 标准库(glibc) 提供的函数,属于 <dirent.h>。
简单结论先说:
opendiropendiropendir 最早来自 POSIX.1-1988 / SVID,远早于 Debian 出现opendir 来自哪里POSIX.1-1988, POSIX.1-2001, POSIX.1-2008<dirent.h>| Debian 版本 | 是否支持 opendir |
说明 |
|---|---|---|
| Debian 1.0(1996) | ✅ | 使用 libc5 / 早期 glibc |
| Debian 2.x | ✅ | glibc 2.x |
| Debian 3–12 | ✅ | glibc 2.x |
| Debian 13(testing) | ✅ | glibc 2.38+ |
实际上 不存在“Debian 不支持 opendir”的版本
你可能是想问以下之一:
opendir() vs fdopendir()opendir:一直支持fdopendir:
opendir 返回错误的新行为#include <dirent.h>
#include <stdio.h>
int main() {
DIR *d = opendir(".");
if (d) {
printf("opendir supported\n");
closedir(d);
}
return 0;
}
getconf GNU_LIBC_VERSION
ldd --version
opendiropendir 是 glibc / POSIX 标准函数fdopendir,那是从 Debian 4.0 开始支持如果你指的是 某个具体函数(如 fdopendir、openat、opendir64)或某个内核/库版本,可以告诉我,我可以给你精确对应表。