diff options
author | Steve Peters <steve@fisharerojo.org> | 2007-05-01 15:32:15 +0000 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2007-05-01 15:32:15 +0000 |
commit | 3497a01ff49c0a24f2db9e69c6bb89e36e940ed4 (patch) | |
tree | c6028e5ca43baa2875933c4e28fbb762cbf121c0 /util.c | |
parent | 56d400ed3af68f3e129d79065e75af152cabbe59 (diff) | |
download | perl-3497a01ff49c0a24f2db9e69c6bb89e36e940ed4.tar.gz |
Add Perl_my_dirfd() to util.c
p4raw-id: //depot/perl@31112
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -5807,6 +5807,23 @@ Perl_get_db_sub(pTHX_ SV **svp, CV *cv) } } +int +Perl_my_dirfd(DIR * dir) { + + /* Most dirfd implementations have problems when passed NULL. */ + if(!dir) + return -1; +#ifdef HAS_DIRFD + return dirfd(dir); +#elif defined(HAS_DIR_DD_FD) + return dir->dd_fd; +#else + Perl_die(aTHX_ PL_no_func, "dirfd"); + /* NOT REACHED */ + return 0; +#endif +} + /* * Local variables: * c-indentation-style: bsd |