xref: /freebsd/lib/libsys/creat.2 (revision 29d079c9649174a36a87a26d1f99e3c0b3e78e0c)
1*29d079c9SBrooks Davis.\" Copyright (c) 1989, 1990, 1993
2*29d079c9SBrooks Davis.\"	The Regents of the University of California.  All rights reserved.
3*29d079c9SBrooks Davis.\"
4*29d079c9SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*29d079c9SBrooks Davis.\" modification, are permitted provided that the following conditions
6*29d079c9SBrooks Davis.\" are met:
7*29d079c9SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*29d079c9SBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9*29d079c9SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10*29d079c9SBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11*29d079c9SBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12*29d079c9SBrooks Davis.\" 3. Neither the name of the University nor the names of its contributors
13*29d079c9SBrooks Davis.\"    may be used to endorse or promote products derived from this software
14*29d079c9SBrooks Davis.\"    without specific prior written permission.
15*29d079c9SBrooks Davis.\"
16*29d079c9SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17*29d079c9SBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*29d079c9SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*29d079c9SBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20*29d079c9SBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*29d079c9SBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*29d079c9SBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*29d079c9SBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*29d079c9SBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*29d079c9SBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*29d079c9SBrooks Davis.\" SUCH DAMAGE.
27*29d079c9SBrooks Davis.\"
28*29d079c9SBrooks Davis.Dd September 4, 2019
29*29d079c9SBrooks Davis.Dt CREAT 2
30*29d079c9SBrooks Davis.Os
31*29d079c9SBrooks Davis.Sh NAME
32*29d079c9SBrooks Davis.Nm creat
33*29d079c9SBrooks Davis.Nd create a new file
34*29d079c9SBrooks Davis.Sh LIBRARY
35*29d079c9SBrooks Davis.Lb libc
36*29d079c9SBrooks Davis.Sh SYNOPSIS
37*29d079c9SBrooks Davis.In fcntl.h
38*29d079c9SBrooks Davis.Ft int
39*29d079c9SBrooks Davis.Fn creat "const char *path" "mode_t mode"
40*29d079c9SBrooks Davis.Sh DESCRIPTION
41*29d079c9SBrooks Davis.Bf -symbolic
42*29d079c9SBrooks DavisThis interface is made obsolete by:
43*29d079c9SBrooks Davis.Ef
44*29d079c9SBrooks Davis.Xr open 2 .
45*29d079c9SBrooks Davis.Pp
46*29d079c9SBrooks DavisThe
47*29d079c9SBrooks Davis.Fn creat
48*29d079c9SBrooks Davisfunction
49*29d079c9SBrooks Davisis the same as:
50*29d079c9SBrooks Davis.Bd -literal -offset indent
51*29d079c9SBrooks Davisopen(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
52*29d079c9SBrooks Davis.Ed
53*29d079c9SBrooks Davis.Sh SEE ALSO
54*29d079c9SBrooks Davis.Xr open 2
55*29d079c9SBrooks Davis.Sh HISTORY
56*29d079c9SBrooks DavisThe
57*29d079c9SBrooks Davis.Fn creat
58*29d079c9SBrooks Davisfunction appeared in
59*29d079c9SBrooks Davis.At v1 .
60