xref: /original-bsd/lib/libc/sys/mkfifo.2 (revision a91856c6)
1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)mkfifo.2	6.3 (Berkeley) 03/10/91
7.\"
8.Dd
9.Dt MKFIFO 2
10.Os BSD 4.4
11.Sh NAME
12.Nm mkfifo
13.Nd make a fifo file
14.Sh SYNOPSIS
15.Fd #include <sys/stat.h>
16.Ft int
17.Fn mkfifo "const char *path" "mode_t mode"
18.Sh DESCRIPTION
19.Fn Mkfifo
20creates a new fifo file with name
21.Fa path .
22The access permissions are
23specified by
24.Fa mode
25and restricted by the
26.Xr umask 2
27of the calling process.
28.Pp
29The fifo's owner ID is set to the process's effective user ID.
30The fifo's group ID is set to that of the parent directory in
31which it is created.
32.Sh RETURN VALUES
33A 0 return value indicates success.  A -1 return value
34indicates an error, and an error code is stored in
35.Va errno .
36.Sh ERRORS
37.Fn Mkfifo
38will fail and no fifo will be created if:
39.Bl -tag -width ENAMETOOLO
40.It Bq Er ENOTSUPP
41The kernel has not been configured to support fifo's.
42.It Bq Er ENOTDIR
43A component of the path prefix is not a directory.
44.It Bq Er EINVAL
45The pathname contains a character with the high-order bit set.
46.It Bq Er ENAMETOOLONG
47A component of a pathname exceeded 255 characters,
48or an entire path name exceeded 1023 characters.
49.It Bq Er ENOENT
50A component of the path prefix does not exist.
51.It Bq Er EACCES
52Search permission is denied for a component of the path prefix.
53.It Bq Er ELOOP
54Too many symbolic links were encountered in translating the pathname.
55.It Bq Er EPERM
56The
57.Fa path
58argument contains a byte with the high-order bit set.
59.It Bq Er EROFS
60The named file resides on a read-only file system.
61.It Bq Er EEXIST
62The named file exists.
63.It Bq Er ENOSPC
64The directory in which the entry for the new fifo is being placed
65cannot be extended because there is no space left on the file
66system containing the directory.
67.It Bq Er ENOSPC
68There are no free inodes on the file system on which the
69fifo is being created.
70.It Bq Er EDQUOT
71The directory in which the entry for the new fifo
72is being placed cannot be extended because the
73user's quota of disk blocks on the file system
74containing the directory has been exhausted.
75.It Bq Er EDQUOT
76The user's quota of inodes on the file system on
77which the fifo is being created has been exhausted.
78.It Bq Er EIO
79An I/O error occurred while making the directory entry or allocating the inode.
80.It Bq Er EIO
81An I/O error occurred while reading from or writing to the file system.
82.It Bq Er EFAULT
83.Fa Path
84points outside the process's allocated address space.
85.El
86.Sh SEE ALSO
87.Xr chmod 2 ,
88.Xr stat 2 ,
89.Xr umask 2
90.Sh STANDARDS
91.Fn Mkfifo
92conforms to IEEE Std 1003.1-1988
93.Pq Dq Tn POSIX .
94