creat.c revision 56698
1212420Sken/* 2212420Sken * Copyright (c) 1989, 1993 3212420Sken * The Regents of the University of California. All rights reserved. 4212420Sken * 5212420Sken * Redistribution and use in source and binary forms, with or without 6212420Sken * modification, are permitted provided that the following conditions 7212420Sken * are met: 8212420Sken * 1. Redistributions of source code must retain the above copyright 9212420Sken * notice, this list of conditions and the following disclaimer. 10212420Sken * 2. Redistributions in binary form must reproduce the above copyright 11212420Sken * notice, this list of conditions and the following disclaimer in the 12212420Sken * documentation and/or other materials provided with the distribution. 13212420Sken * 3. All advertising materials mentioning features or use of this software 14212420Sken * must display the following acknowledgement: 15212420Sken * This product includes software developed by the University of 16212420Sken * California, Berkeley and its contributors. 17212420Sken * 4. Neither the name of the University nor the names of its contributors 18212420Sken * may be used to endorse or promote products derived from this software 19212420Sken * without specific prior written permission. 20212420Sken * 21212420Sken * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22212420Sken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23212420Sken * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24212420Sken * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25212420Sken * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26212420Sken * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27212420Sken * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28212420Sken * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29212420Sken * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30230592Sken * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31212420Sken * SUCH DAMAGE. 32230592Sken * 33230592Sken * $FreeBSD: head/lib/libc/compat-43/creat.c 56698 2000-01-27 23:07:25Z jasone $ 34230592Sken */ 35230592Sken 36230592Sken#if defined(LIBC_SCCS) && !defined(lint) 37230592Skenstatic char sccsid[] = "@(#)creat.c 8.1 (Berkeley) 6/2/93"; 38230592Sken#endif /* LIBC_SCCS and not lint */ 39230592Sken 40230592Sken#include <fcntl.h> 41230592Sken 42230592Skenint 43230592Sken#if __STDC__ 44230592Sken__creat(const char *path, mode_t mode) 45230592Sken#else 46230592Sken__creat(path, mode) 47230592Sken char *path; 48230592Sken mode_t mode; 49230592Sken#endif 50230592Sken{ 51230592Sken return(_open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)); 52230592Sken} 53230592Sken 54230592Sken__weak_reference(__creat, creat); 55230592Sken