xref: /netbsd-src/lib/libc/stdio/mkostemp.c (revision 017500be430b31a8e5d5f54ceeabdd78d346dc69)
1*017500beSchristos /*	$NetBSD: mkostemp.c,v 1.1 2014/06/18 17:47:58 christos Exp $	*/
2*017500beSchristos 
3*017500beSchristos /*-
4*017500beSchristos  * Copyright (c) 2014 The NetBSD Foundation, Inc.
5*017500beSchristos  * All rights reserved.
6*017500beSchristos  *
7*017500beSchristos  * Redistribution and use in source and binary forms, with or without
8*017500beSchristos  * modification, are permitted provided that the following conditions
9*017500beSchristos  * are met:
10*017500beSchristos  * 1. Redistributions of source code must retain the above copyright
11*017500beSchristos  *    notice, this list of conditions and the following disclaimer.
12*017500beSchristos  * 2. Redistributions in binary form must reproduce the above copyright
13*017500beSchristos  *    notice, this list of conditions and the following disclaimer in the
14*017500beSchristos  *    documentation and/or other materials provided with the distribution.
15*017500beSchristos  *
16*017500beSchristos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17*017500beSchristos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18*017500beSchristos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19*017500beSchristos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20*017500beSchristos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*017500beSchristos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*017500beSchristos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*017500beSchristos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*017500beSchristos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*017500beSchristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*017500beSchristos  * POSSIBILITY OF SUCH DAMAGE.
27*017500beSchristos  */
28*017500beSchristos #include "gettemp.h"
29*017500beSchristos 
30*017500beSchristos int
mkostemp(char * path,int oflags)31*017500beSchristos mkostemp(char *path, int oflags)
32*017500beSchristos {
33*017500beSchristos 	int fd;
34*017500beSchristos 
35*017500beSchristos 	return GETTEMP(path, &fd, 0, 0, oflags) ? fd : -1;
36*017500beSchristos }
37