xref: /haiku/src/system/libroot/posix/stdio/rename.c (revision 220d04022750f40f8bac8f01fa551211e28d04f2)
1 /*
2  * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <errno.h>
8 #include <stdio.h>
9 
10 #include <errno_private.h>
11 #include <syscalls.h>
12 #include <syscall_utils.h>
13 
14 
15 int
16 rename(const char *from, const char *to)
17 {
18 	RETURN_AND_SET_ERRNO(_kern_rename(-1, from, -1, to));
19 }
20 
21 
22 int
23 renameat(int fromFD, const char* from, int toFD, const char* to)
24 {
25 	RETURN_AND_SET_ERRNO(_kern_rename(fromFD, from, toFD, to));
26 }
27