1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / mkfifo.3c
blob29de2b15e31a62579f08d1a366162328e566d714
1 '\" te
2 .\" Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH MKFIFO 3C "Apr 24, 2002"
13 .SH NAME
14 mkfifo \- make a FIFO special file
15 .SH SYNOPSIS
16 .LP
17 .nf
18 #include <sys/types.h>
19 #include <sys/stat.h>
21 \fBint\fR \fBmkfifo\fR(\fBconst char *\fR\fIpath\fR, \fBmode_t\fR \fImode\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 The \fBmkfifo()\fR function creates a new FIFO special file named by the
28 pathname pointed to by \fIpath\fR.  The file permission bits of the new FIFO
29 are initialized from \fImode\fR.  The file permission bits of the \fImode\fR
30 argument are modified by the process's file creation mask (see \fBumask\fR(2)).
31 Bits other than the file permission bits in \fImode\fR are ignored.
32 .sp
33 .LP
34 If \fIpath\fR names a symbolic link, \fBmkfifo()\fR fails and sets \fBerrno\fR
35 to \fBEEXIST\fR.
36 .sp
37 .LP
38 The FIFO's user ID is set to the process's effective user ID. The FIFO's group
39 ID is set to the group ID of the parent directory or to the effective group ID
40 of the process.
41 .sp
42 .LP
43 The \fBmkfifo()\fR function calls \fBmknod\fR(2) to create the file.
44 .sp
45 .LP
46 Upon successful completion, \fBmkfifo()\fR marks for update the \fBst_atime\fR,
47 \fBst_ctime\fR, and \fBst_mtime\fR fields of the file. Also, the \fBst_ctime\fR
48 and \fBst_mtime\fR fields of the directory that contains the new entry are
49 marked for update.
50 .SH RETURN VALUES
51 .sp
52 .LP
53 Upon successful completion, \fB0\fR is returned.  Otherwise, \fB\(mi1\fR is
54 returned and \fBerrno\fR is set to indicate the error.
55 .SH ERRORS
56 .sp
57 .LP
58 The \fBmkfifo()\fR function will fail if:
59 .sp
60 .ne 2
61 .na
62 \fB\fBEACCES\fR\fR
63 .ad
64 .RS 16n
65 A component of the path prefix denies search permission, or write permission is
66 denied on the parent directory of the FIFO to be created.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fBEEXIST\fR\fR
73 .ad
74 .RS 16n
75 The named file already exists.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fBELOOP\fR\fR
82 .ad
83 .RS 16n
84 A loop exists in symbolic links encountered during resolution of the \fIpath\fR
85 argument.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fBENAMETOOLONG\fR\fR
92 .ad
93 .RS 16n
94 The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR} or a pathname
95 component is longer than {\fBNAME_MAX\fR}.
96 .RE
98 .sp
99 .ne 2
101 \fB\fBENOENT\fR\fR
103 .RS 16n
104 A component of the path prefix specified by \fIpath\fR does not name an
105 existing directory or \fIpath\fR is an empty string.
109 .ne 2
111 \fB\fBENOSPC\fR\fR
113 .RS 16n
114 The directory that would contain the new file cannot be extended or the file
115 system is out of file-allocation resources.
119 .ne 2
121 \fB\fBENOTDIR\fR\fR
123 .RS 16n
124 A component of the path prefix is not a directory.
128 .ne 2
130 \fB\fBEROFS\fR\fR
132 .RS 16n
133 The named file resides on a read-only file system.
138 The \fBmkfifo()\fR function may fail if:
140 .ne 2
142 \fB\fBELOOP\fR\fR
144 .RS 16n
145 Too many symbolic links were encountered in resolving \fIpath\fR.
149 .ne 2
151 \fB\fBENAMETOOLONG\fR\fR
153 .RS 16n
154 The length of the \fIpath\fR argument exceeds {\fBPATH_MAX\fR} or a pathname
155 component is longer than {\fBNAME_MAX\fR}.
158 .SH EXAMPLES
160 \fBExample 1 \fRCreate a FIFO File
163 The following example demonstrates how to create a FIFO file named
164 \fB/home/cnd/mod_done\fR with read and write permissions for the owner and read
165 permissions for the group and others.
168 .in +2
170 #include sys/types.h>
171 #include sys/stat.h>
172 int status;
173 \&...
174 status = mkfifo("/home/cnd/mod_done", S_IWUSR | S_IRUSR |
175         S_IRGRP | S_IROTH);
177 .in -2
179 .SH ATTRIBUTES
182 See \fBattributes\fR(5) for descriptions of the following attributes:
187 box;
188 c | c
189 l | l .
190 ATTRIBUTE TYPE  ATTRIBUTE VALUE
192 Interface Stability     Standard
194 MT-Level        MT-Safe
197 .SH SEE ALSO
200 \fBmkdir\fR(1), \fBchmod\fR(2), \fBexec\fR(2), \fBmknod\fR(2), \fBumask\fR(2),
201 \fBstat.h\fR(3HEAD), \fBufs\fR(7FS), \fBattributes\fR(5), \fBstandards\fR(5)