Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / libbind / dist / isc / movefile.c
blob52810b8131cf56ad3ca9ce65f43ca830bbc6a155
1 /* $NetBSD$ */
3 /*
4 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (c) 2000 by Internet Software Consortium, Inc.
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #include <port_before.h>
22 #include <stdio.h>
23 #include <isc/misc.h>
24 #include <port_after.h>
25 #ifndef HAVE_MOVEFILE
27 * rename() is lame (can't overwrite an existing file) on some systems.
28 * use movefile() instead, and let lame OS ports do what they need to.
31 int
32 isc_movefile(const char *oldname, const char *newname) {
33 return (rename(oldname, newname));
35 #else
36 static int os_port_has_isc_movefile = 1;
37 #endif
39 /*! \file */