* 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

@ -1,3 +1,11 @@
2012-02-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* 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.
2012-02-21 Corinna Vinschen <corinna@vinschen.de>
Based on an idea from Nick Lowe <nick.lowe@gmail.com>:
@ -165,7 +173,7 @@
Explain how and why.
* thread.h (PTHREAD_DEFAULT_STACKSIZE): Change definition. Explain why.
2012-02-12 Yaakov Selkowitz <yselkowitz@users.sourceforg.net>
2012-02-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* include/pthread.h: Include time.h as required by POSIX.

View File

@ -1406,6 +1406,7 @@ scalbnf NOSIGFE
_scalbnf = scalbnf NOSIGFE
scandir SIGFE
_scandir = scandir SIGFE
scandirat SIGFE
scanf SIGFE
_scanf = scanf SIGFE
scanf_r = _scanf_r SIGFE

View File

@ -428,12 +428,13 @@ details. */
257: Export getpt.
258: Export get_current_dir_name.
259: Export pthread_sigqueue.
260: Export scandirat.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
#define CYGWIN_VERSION_API_MINOR 259
#define CYGWIN_VERSION_API_MINOR 260
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible

View File

@ -1,6 +1,6 @@
/* Posix dirent.h for WIN32.
Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2010 Red Hat, Inc.
Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2010, 2012 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@ -69,6 +69,10 @@ int scandir (const char *__dir,
int (*select) (const struct dirent *),
int (*compar) (const struct dirent **, const struct dirent **));
int scandirat (int __dirfd, const char *__dir, struct dirent ***__namelist,
int (*select) (const struct dirent *),
int (*compar) (const struct dirent **, const struct dirent **));
int alphasort (const struct dirent **__a, const struct dirent **__b);
#ifdef _DIRENT_HAVE_D_TYPE
/* File types for `d_type'. */

View File

@ -1136,6 +1136,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
pthread_sigqueue
ptsname_r
removexattr
scandirat
setxattr
strchrnul
sysinfo

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)
{