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:
parent
43779f9b97
commit
c990f8d93d
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue