summaryrefslogtreecommitdiff
path: root/src/stdio/rename.c
blob: 9a701a1d0e16cbc59e2cccf868cd728ffa52fa49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "_stdio.h"
#include "_syscall.h"

/** rename a file **/

int rename(const char *old, const char *new)
{
	SIGNAL_SAFE(0);
	ASSERT_NOOVERLAP(old, strlen(old), new, strlen(new));
	SYSCALL(rename, int, -1, old, new, 0, 0, 0, 0);
}

/***
renames a file from its original name ARGUMENT(old) to
ARGUMENT(new).
***/

/*
IMPLEMENTATION(Behavior if ARGUMENT(new) exists prior to THIS() being called)
STDC(1)
*/