diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-31 16:58:25 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-31 16:58:25 +0000 |
commit | 06b7d9af9f53b12a3eaf856d03835bc930947fd5 (patch) | |
tree | 05c72232921506267745298724eee2cbf2419b46 /lib/libc | |
parent | 223d3b7ab3da07201bf0d846f6987c4b14c09fbe (diff) |
__fdnlist() is used by libkvm
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/nlist.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 6e304e6f7ed..347982a3123 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -281,6 +281,21 @@ static struct nlist_handlers { #endif }; +__fdnlist(fd, list) + register int fd; + register struct nlist *list; +{ + int n, i; + + for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { + n = (nlist_fn[i].fn)(fd, list); + if (n != -1) + break; + } + return (n); +} + + int nlist(name, list) const char *name; @@ -292,11 +307,7 @@ nlist(name, list) fd = open(name, O_RDONLY, 0); if (fd < 0) return (-1); - for (i = 0; i < sizeof(nlist_fn)/sizeof(nlist_fn[0]); i++) { - n = (nlist_fn[i].fn)(fd, list); - if (n != -1) - break; - } + n = __fdnlist(fd, list); (void)close(fd); return (n); } |