ref: 16aaa24c7604b5f9d492796b20179427adb0a91b
dir: /sys/src/ape/lib/ap/stdio/rename.c/
/*
* pANS stdio -- rename
*/
#include "iolib.h"
int rename(const char *old, const char *new){
if(link((char *)old, (char *)new)<0) return -1;
if(unlink((char *)old)<0){
unlink((char *)new);
return -1;
}
return 0;
}