1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Implement renameat_noreplace on recent Cygwin

* src/sysdep.c [CYGWIN]: Include cygwin/fs.h.
(renameat_noreplace) [RENAME_NOREPLACE]: Use renameat2.
(Bug#27986)
This commit is contained in:
Ken Brown 2017-09-10 11:00:35 -04:00
parent 43779f9b97
commit c990f8d93d

View file

@ -42,6 +42,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# include <sys/syscall.h>
#endif
#ifdef CYGWIN
# include <cygwin/fs.h>
#endif
#if defined DARWIN_OS || defined __FreeBSD__
# include <sys/sysctl.h>
#endif
@ -2685,6 +2689,8 @@ renameat_noreplace (int srcfd, char const *src, int dstfd, char const *dst)
{
#if defined SYS_renameat2 && defined RENAME_NOREPLACE
return syscall (SYS_renameat2, srcfd, src, dstfd, dst, RENAME_NOREPLACE);
#elif defined RENAME_NOREPLACE /* Cygwin >= 2.9.0. */
return renameat2 (srcfd, src, dstfd, dst, RENAME_NOREPLACE);
#elif defined RENAME_EXCL
return renameatx_np (srcfd, src, dstfd, dst, RENAME_EXCL);
#else