rename (Debugging with ROCGDB)

Next: unlink, Previous: lseek, Up: List of Supported Calls [Contents][Index]

#### rename

Synopsis:

      int rename(const char *oldpath, const char *newpath);

Request:

  ‘`Frename,oldpathptr/len,newpathptr/len`’

Return value:

  On success, zero is returned. On error, -1 is returned.

Errors:
  `EISDIR`

    newpath is an existing directory, but oldpath is not a directory.

  `EEXIST`

    newpath is a non-empty directory.

  `EBUSY`

    oldpath or newpath is a directory that is in use by some process.

  `EINVAL`

    An attempt was made to make a directory a subdirectory of itself.

  `ENOTDIR`

    A component used as a directory in oldpath or new path is not a directory. Or oldpath is a directory and newpath exists but is not a directory.

  `EFAULT`

    oldpathptr or newpathptr are invalid pointer values.

  `EACCES`

    No access to the file or the path of the file.

  `ENAMETOOLONG`

    oldpath or newpath was too long.

  `ENOENT`

    A directory component in oldpath or newpath does not exist.

  `EROFS`

    The file is on a read-only filesystem.

  `ENOSPC`

    The device containing the file has no room for the new directory entry.

  `EINTR`

    The call was interrupted by the user.