* this function is a POSIX compliant version, which will rename old file name * to new file name. * * @param old_file the old file name. * @param new_file the new file name. * * @return 0 on successful, -1 on failed. * * note: the old and new file name must be belong to a same file system. */
| 347 | * note: the old and new file name must be belong to a same file system. |
| 348 | */ |
| 349 | int rename(const char *old_file, const char *new_file) |
| 350 | { |
| 351 | int result; |
| 352 | |
| 353 | result = dfs_file_rename(old_file, new_file); |
| 354 | if (result < 0) |
| 355 | { |
| 356 | rt_set_errno(result); |
| 357 | |
| 358 | return -1; |
| 359 | } |
| 360 | |
| 361 | return 0; |
| 362 | } |
| 363 | RTM_EXPORT(rename); |
| 364 | #endif |
| 365 |