* 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.
This commit is contained in:
Yaakov Selkowitz
2012-02-22 01:58:24 +00:00
parent de6ebe0e8b
commit e587f14b6f
6 changed files with 34 additions and 3 deletions

View File

@@ -39,6 +39,7 @@ details. */
#include <wctype.h>
#include <unistd.h>
#include <sys/wait.h>
#include <dirent.h>
#include "ntdll.h"
#undef fstat
@@ -4436,6 +4437,21 @@ renameat (int olddirfd, const char *oldpathname,
return rename (oldpath, newpath);
}
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)
{