2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <lib.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2013-12-02 16:24:13 +01:00
|
|
|
#ifdef __weak_alias
|
|
|
|
__weak_alias(__posix_rename, rename)
|
|
|
|
#endif
|
|
|
|
|
2011-11-28 11:07:55 +01:00
|
|
|
int rename(const char *name, const char *name2)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
2014-05-12 13:47:18 +02:00
|
|
|
m.m_lc_vfs_link.len1 = strlen(name) + 1;
|
|
|
|
m.m_lc_vfs_link.len2 = strlen(name2) + 1;
|
|
|
|
m.m_lc_vfs_link.name1 = (vir_bytes)name;
|
|
|
|
m.m_lc_vfs_link.name2 = (vir_bytes)name2;
|
2013-11-04 22:48:08 +01:00
|
|
|
return(_syscall(VFS_PROC_NR, VFS_RENAME, &m));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|