1<html lang="en"> 2<head> 3<title>rename - Debugging with GDB</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Debugging with GDB"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="List-of-Supported-Calls.html#List-of-Supported-Calls" title="List of Supported Calls"> 9<link rel="prev" href="lseek.html#lseek" title="lseek"> 10<link rel="next" href="unlink.html#unlink" title="unlink"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988-2013 Free Software Foundation, Inc. 14 15Permission is granted to copy, distribute and/or modify this document 16under the terms of the GNU Free Documentation License, Version 1.3 or 17any later version published by the Free Software Foundation; with the 18Invariant Sections being ``Free Software'' and ``Free Software Needs 19Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' 20and with the Back-Cover Texts as in (a) below. 21 22(a) The FSF's Back-Cover Text is: ``You are free to copy and modify 23this GNU Manual. Buying copies from GNU Press supports the FSF in 24developing GNU and promoting software freedom.'' 25--> 26<meta http-equiv="Content-Style-Type" content="text/css"> 27<style type="text/css"><!-- 28 pre.display { font-family:inherit } 29 pre.format { font-family:inherit } 30 pre.smalldisplay { font-family:inherit; font-size:smaller } 31 pre.smallformat { font-family:inherit; font-size:smaller } 32 pre.smallexample { font-size:smaller } 33 pre.smalllisp { font-size:smaller } 34 span.sc { font-variant:small-caps } 35 span.roman { font-family:serif; font-weight:normal; } 36 span.sansserif { font-family:sans-serif; font-weight:normal; } 37--></style> 38<link rel="stylesheet" type="text/css" href="../cs.css"> 39</head> 40<body> 41<div class="node"> 42<a name="rename"></a> 43<p> 44Next: <a rel="next" accesskey="n" href="unlink.html#unlink">unlink</a>, 45Previous: <a rel="previous" accesskey="p" href="lseek.html#lseek">lseek</a>, 46Up: <a rel="up" accesskey="u" href="List-of-Supported-Calls.html#List-of-Supported-Calls">List of Supported Calls</a> 47<hr> 48</div> 49 50<h5 class="unnumberedsubsubsec">rename</h5> 51 52<p><a name="index-rename_002c-file_002di_002fo-system-call-2851"></a> 53 <dl> 54<dt>Synopsis:<dd> 55 <pre class="smallexample"> int rename(const char *oldpath, const char *newpath); 56</pre> 57 <br><dt>Request:<dd>‘<samp><span class="samp">Frename,</span><var>oldpathptr</var><span class="samp">/</span><var>len</var><span class="samp">,</span><var>newpathptr</var><span class="samp">/</span><var>len</var></samp>’ 58 59 <br><dt>Return value:<dd>On success, zero is returned. On error, -1 is returned. 60 61 <br><dt>Errors:<dd> 62 <dl> 63<dt><code>EISDIR</code><dd><var>newpath</var> is an existing directory, but <var>oldpath</var> is not a 64directory. 65 66 <br><dt><code>EEXIST</code><dd><var>newpath</var> is a non-empty directory. 67 68 <br><dt><code>EBUSY</code><dd><var>oldpath</var> or <var>newpath</var> is a directory that is in use by some 69process. 70 71 <br><dt><code>EINVAL</code><dd>An attempt was made to make a directory a subdirectory 72of itself. 73 74 <br><dt><code>ENOTDIR</code><dd>A component used as a directory in <var>oldpath</var> or new 75path is not a directory. Or <var>oldpath</var> is a directory 76and <var>newpath</var> exists but is not a directory. 77 78 <br><dt><code>EFAULT</code><dd><var>oldpathptr</var> or <var>newpathptr</var> are invalid pointer values. 79 80 <br><dt><code>EACCES</code><dd>No access to the file or the path of the file. 81 82 <br><dt><code>ENAMETOOLONG</code><dd> 83<var>oldpath</var> or <var>newpath</var> was too long. 84 85 <br><dt><code>ENOENT</code><dd>A directory component in <var>oldpath</var> or <var>newpath</var> does not exist. 86 87 <br><dt><code>EROFS</code><dd>The file is on a read-only filesystem. 88 89 <br><dt><code>ENOSPC</code><dd>The device containing the file has no room for the new 90directory entry. 91 92 <br><dt><code>EINTR</code><dd>The call was interrupted by the user. 93</dl> 94 95 </dl> 96 97 </body></html> 98 99