1*95acdafaSAntonio Huete Jimenez.\" Copyright (c) 1996 Doug Rabson 2*95acdafaSAntonio Huete Jimenez.\" 3*95acdafaSAntonio Huete Jimenez.\" All rights reserved. 4*95acdafaSAntonio Huete Jimenez.\" 5*95acdafaSAntonio Huete Jimenez.\" This program is free software. 6*95acdafaSAntonio Huete Jimenez.\" 7*95acdafaSAntonio Huete Jimenez.\" Redistribution and use in source and binary forms, with or without 8*95acdafaSAntonio Huete Jimenez.\" modification, are permitted provided that the following conditions 9*95acdafaSAntonio Huete Jimenez.\" are met: 10*95acdafaSAntonio Huete Jimenez.\" 1. Redistributions of source code must retain the above copyright 11*95acdafaSAntonio Huete Jimenez.\" notice, this list of conditions and the following disclaimer. 12*95acdafaSAntonio Huete Jimenez.\" 2. Redistributions in binary form must reproduce the above copyright 13*95acdafaSAntonio Huete Jimenez.\" notice, this list of conditions and the following disclaimer in the 14*95acdafaSAntonio Huete Jimenez.\" documentation and/or other materials provided with the distribution. 15*95acdafaSAntonio Huete Jimenez.\" 16*95acdafaSAntonio Huete Jimenez.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 17*95acdafaSAntonio Huete Jimenez.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18*95acdafaSAntonio Huete Jimenez.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19*95acdafaSAntonio Huete Jimenez.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 20*95acdafaSAntonio Huete Jimenez.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21*95acdafaSAntonio Huete Jimenez.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22*95acdafaSAntonio Huete Jimenez.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23*95acdafaSAntonio Huete Jimenez.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24*95acdafaSAntonio Huete Jimenez.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25*95acdafaSAntonio Huete Jimenez.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26*95acdafaSAntonio Huete Jimenez.\" 27*95acdafaSAntonio Huete Jimenez.\" $FreeBSD: src/share/man/man9/VOP_RENAME.9,v 1.10.2.2 2001/12/17 11:30:18 ru Exp $ 28*95acdafaSAntonio Huete Jimenez.\" 29*95acdafaSAntonio Huete Jimenez.Dd October 13, 2014 30*95acdafaSAntonio Huete Jimenez.Dt VOP_OLD_RENAME 9 31*95acdafaSAntonio Huete Jimenez.Os 32*95acdafaSAntonio Huete Jimenez.Sh NAME 33*95acdafaSAntonio Huete Jimenez.Nm VOP_OLD_RENAME 34*95acdafaSAntonio Huete Jimenez.Nd rename a file 35*95acdafaSAntonio Huete Jimenez.Sh SYNOPSIS 36*95acdafaSAntonio Huete Jimenez.In sys/param.h 37*95acdafaSAntonio Huete Jimenez.In sys/vnode.h 38*95acdafaSAntonio Huete Jimenez.Ft int 39*95acdafaSAntonio Huete Jimenez.Fn VOP_OLD_RENAME "struct vnode *fdvp" "struct vnode *fvp" "struct componentname *fcnp" "struct vnode *tdvp" "struct vnode *tvp" "struct componentname *tcnp" 40*95acdafaSAntonio Huete Jimenez.Sh DESCRIPTION 41*95acdafaSAntonio Huete JimenezThis renames a file and possibly changes its parent directory. 42*95acdafaSAntonio Huete JimenezIf the destination object exists, it will be removed first. 43*95acdafaSAntonio Huete Jimenez.Pp 44*95acdafaSAntonio Huete JimenezIts arguments are: 45*95acdafaSAntonio Huete Jimenez.Bl -tag -width fdvp 46*95acdafaSAntonio Huete Jimenez.It Fa fdvp 47*95acdafaSAntonio Huete Jimenezthe vnode of the old parent directory 48*95acdafaSAntonio Huete Jimenez.It Fa fvp 49*95acdafaSAntonio Huete Jimenezthe vnode of the file to be renamed 50*95acdafaSAntonio Huete Jimenez.It Fa fcnp 51*95acdafaSAntonio Huete Jimenezpathname information about the file's current name 52*95acdafaSAntonio Huete Jimenez.It Fa tdvp 53*95acdafaSAntonio Huete Jimenezthe vnode of the new parent directory 54*95acdafaSAntonio Huete Jimenez.It Fa tvp 55*95acdafaSAntonio Huete Jimenezthe vnode of the target file (if it exists) 56*95acdafaSAntonio Huete Jimenez.It Fa tcnp 57*95acdafaSAntonio Huete Jimenezpathname information about the file's new name 58*95acdafaSAntonio Huete Jimenez.El 59*95acdafaSAntonio Huete Jimenez.Sh LOCKS 60*95acdafaSAntonio Huete JimenezThe source directory and file are unlocked but are expected to have their 61*95acdafaSAntonio Huete Jimenezref count bumped on entry. The VOP routine is expected to 62*95acdafaSAntonio Huete Jimenez.Fn vrele 63*95acdafaSAntonio Huete Jimenezboth prior 64*95acdafaSAntonio Huete Jimenezto returning. 65*95acdafaSAntonio Huete Jimenez.Pp 66*95acdafaSAntonio Huete JimenezThe destination directory and file are locked as well as having their ref 67*95acdafaSAntonio Huete Jimenezcount bumped. The VOP routine is expected to 68*95acdafaSAntonio Huete Jimenez.Fn vput 69*95acdafaSAntonio Huete Jimenezboth prior to 70*95acdafaSAntonio Huete Jimenezreturning. 71*95acdafaSAntonio Huete Jimenez.Sh ERRORS 72*95acdafaSAntonio Huete Jimenez.Bl -tag -width Er 73*95acdafaSAntonio Huete Jimenez.It Bq Er EPERM 74*95acdafaSAntonio Huete Jimenezthe file is immutable 75*95acdafaSAntonio Huete Jimenez.It Bq Er EXDEV 76*95acdafaSAntonio Huete Jimenezcross device move 77*95acdafaSAntonio Huete Jimenez.It Bq Er EINVAL 78*95acdafaSAntonio Huete Jimenezillegal directory rename 79*95acdafaSAntonio Huete Jimenez.It Bq Er ENOTDIR 80*95acdafaSAntonio Huete Jimenezattempt to rename a directory to a file or vice versa 81*95acdafaSAntonio Huete Jimenez.It Bq Er ENOTEMPTY 82*95acdafaSAntonio Huete Jimenezattempt to remove a directory which is not empty 83*95acdafaSAntonio Huete Jimenez.El 84*95acdafaSAntonio Huete Jimenez.Sh SEE ALSO 85*95acdafaSAntonio Huete Jimenez.Xr vnode 9 86*95acdafaSAntonio Huete Jimenez.Sh AUTHORS 87*95acdafaSAntonio Huete JimenezThis man page was written by 88*95acdafaSAntonio Huete Jimenez.An Doug Rabson . 89