diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2012-02-22 01:58:24 +0000 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2012-02-22 01:58:24 +0000 |
commit | e587f14b6f60bbf702a1a13c4399446d9654b708 (patch) | |
tree | 9a4817c4093d18a2d8356c171b3533a01b570962 /winsup/cygwin/syscalls.cc | |
parent | de6ebe0e8bf427356df9e3ecd9dc9fa9d2ca8053 (diff) | |
download | cygnal-e587f14b6f60bbf702a1a13c4399446d9654b708.tar.gz cygnal-e587f14b6f60bbf702a1a13c4399446d9654b708.tar.bz2 cygnal-e587f14b6f60bbf702a1a13c4399446d9654b708.zip |
* cygwin.din (scandirat): Export.
* posix.sgml (std-gnu): Add scandirat.
* syscalls.cc (scandirat): New function.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* include/sys/dirent.h (scandirat): Declare.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 8cdadb2d7..21037fa10 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -39,6 +39,7 @@ details. */ #include <wctype.h> #include <unistd.h> #include <sys/wait.h> +#include <dirent.h> #include "ntdll.h" #undef fstat @@ -4437,6 +4438,21 @@ renameat (int olddirfd, const char *oldpathname, } extern "C" int +scandirat (int dirfd, const char *pathname, struct dirent ***namelist, + int (*select) (const struct dirent *), + int (*compar) (const struct dirent **, const struct dirent **)) +{ + tmp_pathbuf tp; + myfault efault; + if (efault.faulted (EFAULT)) + return -1; + char *path = tp.c_get (); + if (gen_full_path_at (path, dirfd, pathname)) + return -1; + return scandir (pathname, namelist, select, compar); +} + +extern "C" int symlinkat (const char *oldpath, int newdirfd, const char *newpathname) { tmp_pathbuf tp; |