update from Donn -- fixes for pcc
[unix-history] / usr / src / lib / libc / sys / mkfifo.2
CommitLineData
931b8415 1.\" Copyright (c) 1990, 1991 The Regents of the University of California.
e1d4f580
KM
2.\" All rights reserved.
3.\"
91cff1e1 4.\" %sccs.include.redist.man%
e1d4f580 5.\"
931b8415 6.\" @(#)mkfifo.2 6.3 (Berkeley) %G%
e1d4f580 7.\"
931b8415
CL
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
e1d4f580 20creates a new fifo file with name
931b8415
CL
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
e1d4f580
KM
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.
931b8415
CL
32.Sh RETURN VALUES
33A 0 return value indicates success. A -1 return value
e1d4f580 34indicates an error, and an error code is stored in
931b8415
CL
35.Va errno .
36.Sh ERRORS
37.Fn Mkfifo
e1d4f580 38will fail and no fifo will be created if:
931b8415
CL
39.Bl -tag -width ENAMETOOLO
40.It Bq Er ENOTSUPP
e1d4f580 41The kernel has not been configured to support fifo's.
931b8415 42.It Bq Er ENOTDIR
e1d4f580 43A component of the path prefix is not a directory.
931b8415 44.It Bq Er EINVAL
e1d4f580 45The pathname contains a character with the high-order bit set.
931b8415 46.It Bq Er ENAMETOOLONG
e1d4f580
KM
47A component of a pathname exceeded 255 characters,
48or an entire path name exceeded 1023 characters.
931b8415 49.It Bq Er ENOENT
e1d4f580 50A component of the path prefix does not exist.
931b8415 51.It Bq Er EACCES
e1d4f580 52Search permission is denied for a component of the path prefix.
931b8415 53.It Bq Er ELOOP
e1d4f580 54Too many symbolic links were encountered in translating the pathname.
931b8415
CL
55.It Bq Er EPERM
56The
57.Fa path
58argument contains a byte with the high-order bit set.
59.It Bq Er EROFS
e1d4f580 60The named file resides on a read-only file system.
931b8415 61.It Bq Er EEXIST
e1d4f580 62The named file exists.
931b8415 63.It Bq Er ENOSPC
e1d4f580
KM
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.
931b8415 67.It Bq Er ENOSPC
e1d4f580
KM
68There are no free inodes on the file system on which the
69fifo is being created.
931b8415 70.It Bq Er EDQUOT
e1d4f580
KM
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.
931b8415 75.It Bq Er EDQUOT
e1d4f580
KM
76The user's quota of inodes on the file system on
77which the fifo is being created has been exhausted.
931b8415 78.It Bq Er EIO
e1d4f580 79An I/O error occurred while making the directory entry or allocating the inode.
931b8415 80.It Bq Er EIO
e1d4f580 81An I/O error occurred while reading from or writing to the file system.
931b8415
CL
82.It Bq Er EFAULT
83.Fa Path
e1d4f580 84points outside the process's allocated address space.
931b8415
CL
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 .