1.\" Copyright (c) 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)mkfifo.2 8.1 (Berkeley) 6/4/93 29.\" $FreeBSD$ 30.\" 31.Dd March 30, 2020 32.Dt MKFIFO 2 33.Os 34.Sh NAME 35.Nm mkfifo , 36.Nm mkfifoat 37.Nd make a fifo file 38.Sh LIBRARY 39.Lb libc 40.Sh SYNOPSIS 41.In sys/types.h 42.In sys/stat.h 43.Ft int 44.Fn mkfifo "const char *path" "mode_t mode" 45.Ft int 46.Fn mkfifoat "int fd" "const char *path" "mode_t mode" 47.Sh DESCRIPTION 48The 49.Fn mkfifo 50system call 51creates a new fifo file with name 52.Fa path . 53The access permissions are 54specified by 55.Fa mode 56and restricted by the 57.Xr umask 2 58of the calling process. 59.Pp 60The fifo's owner ID is set to the process's effective user ID. 61The fifo's group ID is set to that of the parent directory in 62which it is created. 63.Pp 64The 65.Fn mkfifoat 66system call is equivalent to 67.Fn mkfifo 68except in the case where 69.Fa path 70specifies a relative path. 71In this case the newly created FIFO is created relative to the 72directory associated with the file descriptor 73.Fa fd 74instead of the current working directory. 75If 76.Fn mkfifoat 77is passed the special value 78.Dv AT_FDCWD 79in the 80.Fa fd 81parameter, the current working directory is used and the behavior is 82identical to a call to 83.Fn mkfifo . 84.Sh RETURN VALUES 85.Rv -std mkfifo 86.Sh ERRORS 87The 88.Fn mkfifo 89system call 90will fail and no fifo will be created if: 91.Bl -tag -width Er 92.It Bq Er ENOTSUP 93The kernel has not been configured to support fifo's. 94.It Bq Er ENOTDIR 95A component of the path prefix is not a directory. 96.It Bq Er ENAMETOOLONG 97A component of a pathname exceeded 255 characters, 98or an entire path name exceeded 1023 characters. 99.It Bq Er ENOENT 100A component of the path prefix does not exist. 101.It Bq Er EACCES 102A component of the path prefix denies search permission, or write permission 103is denied on the parent directory of the fifo to be created. 104.It Bq Er ELOOP 105Too many symbolic links were encountered in translating the pathname. 106.It Bq Er EROFS 107The named file would reside on a read-only file system. 108.It Bq Er EEXIST 109The named file exists. 110.It Bq Er EPERM 111The parent directory of the named file has its immutable flag set, see the 112.Xr chflags 2 113manual page for more information. 114.It Bq Er ENOSPC 115The directory in which the entry for the new fifo is being placed 116cannot be extended because there is no space left on the file 117system containing the directory. 118.It Bq Er ENOSPC 119There are no free inodes on the file system on which the 120fifo is being created. 121.It Bq Er EDQUOT 122The directory in which the entry for the new fifo 123is being placed cannot be extended because the 124user's quota of disk blocks on the file system 125containing the directory has been exhausted. 126.It Bq Er EDQUOT 127The user's quota of inodes on the file system on 128which the fifo is being created has been exhausted. 129.It Bq Er EIO 130An 131.Tn I/O 132error occurred while making the directory entry or allocating the inode. 133.It Bq Er EINTEGRITY 134Corrupted data was detected while reading from the file system. 135.It Bq Er EFAULT 136The 137.Fa path 138argument 139points outside the process's allocated address space. 140.El 141.Pp 142In addition to the errors returned by the 143.Fn mkfifo , 144the 145.Fn mkfifoat 146may fail if: 147.Bl -tag -width Er 148.It Bq Er EBADF 149The 150.Fa path 151argument does not specify an absolute path and the 152.Fa fd 153argument is neither 154.Dv AT_FDCWD 155nor a valid file descriptor open for searching. 156.It Bq Er ENOTDIR 157The 158.Fa path 159argument is not an absolute path and 160.Fa fd 161is neither 162.Dv AT_FDCWD 163nor a file descriptor associated with a directory. 164.El 165.Sh SEE ALSO 166.Xr chflags 2 , 167.Xr chmod 2 , 168.Xr mknod 2 , 169.Xr stat 2 , 170.Xr umask 2 171.Sh STANDARDS 172The 173.Fn mkfifo 174system call is expected to conform to 175.St -p1003.1-90 . 176The 177.Fn mkfifoat 178system call follows The Open Group Extended API Set 2 specification. 179.Sh HISTORY 180The 181.Fn mkfifoat 182system call appeared in 183.Fx 8.0 . 184