PatchworkOS
Loading...
Searching...
No Matches
rename.c
Go to the documentation of this file.
1#include <stdio.h>
2
4
5int rename(const char* oldpath, const char* newpath)
6{
7 if (_syscall_link(oldpath, newpath) == ERR)
8 {
10 return EOF;
11 }
12 if (_syscall_remove(oldpath) == ERR)
13 {
15 return EOF;
16 }
17 return 0;
18}
#define errno
Error number variable.
Definition errno.h:27
#define ERR
Integer error value.
Definition ERR.h:17
int rename(const char *oldpath, const char *newpath)
Definition rename.c:5
static uint64_t _syscall_remove(const char *path)
Definition syscalls.h:238
static uint64_t _syscall_link(const char *oldPath, const char *newPath)
Definition syscalls.h:243
static errno_t _syscall_errno(void)
Definition syscalls.h:118
#define EOF
Definition stdio.h:25