From d73327e2744b81f295e25d1e13f27bf791990a5c Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 17 Jul 2008 01:01:52 +0000 Subject: [PATCH] Make dirfd() publically available. It used on other systems as well it seems. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26466 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/dirent.h | 3 +++ src/system/libroot/posix/dirent.c | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/headers/posix/dirent.h b/headers/posix/dirent.h index f915c5abfc..991adf18d9 100644 --- a/headers/posix/dirent.h +++ b/headers/posix/dirent.h @@ -40,6 +40,9 @@ void rewinddir(DIR *dir); void seekdir(DIR *dir, long int loc); long int telldir(DIR *); +/* Non-POSIX extension to get the FD out of the private DIR */ +int dirfd(DIR *dir); + #ifdef __cplusplus } #endif diff --git a/src/system/libroot/posix/dirent.c b/src/system/libroot/posix/dirent.c index 929c4d4fb0..025d6fb22e 100644 --- a/src/system/libroot/posix/dirent.c +++ b/src/system/libroot/posix/dirent.c @@ -120,18 +120,8 @@ rewinddir(DIR *dir) } -#ifndef _KERNEL_MODE - -/* This is no POSIX compatible call; it's not exported in the headers - * but here for BeOS compatiblity. - */ - -int dirfd(DIR *dir); - int dirfd(DIR *dir) { return dir->fd; } - -#endif // !_KERNEL_MODE