2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" This manpage is Copyright (C) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" changed section from 2 to 3, aeb, 950919
|
|
|
|
.\"
|
2008-06-11 15:26:41 +00:00
|
|
|
.TH MKFIFO 3 2008-06-12 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
mkfifo \- make a FIFO special file (a named pipe)
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <sys/types.h>
|
|
|
|
.B #include <sys/stat.h>
|
|
|
|
.sp
|
|
|
|
.BI "int mkfifo(const char *" pathname ", mode_t " mode );
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR mkfifo ()
|
|
|
|
makes a FIFO special file with name \fIpathname\fP.
|
2007-04-12 22:42:49 +00:00
|
|
|
\fImode\fP specifies the FIFO's permissions.
|
|
|
|
It is modified by the
|
2004-11-03 13:51:07 +00:00
|
|
|
process's \fBumask\fP in the usual way: the permissions of the created
|
|
|
|
file are \fB(\fP\fImode\fP\fB & ~umask)\fP.
|
|
|
|
.PP
|
|
|
|
A FIFO special file is similar to a pipe, except that it is created
|
2007-04-12 22:42:49 +00:00
|
|
|
in a different way.
|
|
|
|
Instead of being an anonymous communications
|
2004-11-03 13:51:07 +00:00
|
|
|
channel, a FIFO special file is entered into the file system by
|
2007-05-12 09:06:04 +00:00
|
|
|
calling
|
|
|
|
.BR mkfifo ().
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
|
|
|
Once you have created a FIFO special file in this way, any process can
|
|
|
|
open it for reading or writing, in the same way as an ordinary file.
|
|
|
|
However, it has to be open at both ends simultaneously before you can
|
2007-04-12 22:42:49 +00:00
|
|
|
proceed to do any input or output operations on it.
|
|
|
|
Opening a FIFO for reading normally blocks until some
|
|
|
|
other process opens the same FIFO for writing, and vice versa.
|
|
|
|
See
|
2006-04-21 01:46:04 +00:00
|
|
|
.BR fifo (7)
|
accept.2, connect.2, eventfd.2, flock.2, open.2, posix_fadvise.2, read.2, recv.2, sched_setscheduler.2, select_tut.2, send.2, signalfd.2, splice.2, timerfd_create.2, write.2, flockfile.3, mkfifo.3, mq_notify.3, mq_open.3, pthread_tryjoin_np.3, scanf.3, random.4, ddp.7, epoll.7, fifo.7, ip.7, pipe.7, socket.7, spufs.7: Global fix: s/non-blocking/nonblocking/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:43:10 +00:00
|
|
|
for nonblocking handling of FIFO special files.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "RETURN VALUE"
|
2007-05-12 13:12:02 +00:00
|
|
|
On success
|
|
|
|
.BR mkfifo ()
|
|
|
|
returns 0.
|
2007-05-01 08:15:41 +00:00
|
|
|
In the case of an error, \-1 is returned (in which case, \fIerrno\fP
|
2004-11-03 13:51:07 +00:00
|
|
|
is set appropriately).
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EACCES
|
|
|
|
One of the directories in \fIpathname\fP did not allow search
|
|
|
|
(execute) permission.
|
|
|
|
.TP
|
link.2, mkdir.2, mknod.2, open.2, rename.2, symlink.2, write.2, mkfifo.3: Document EDQUOT error
The return error EDQUOT is not documented in open(2), write(2),
symlink(2) etc..
Whether inodes or disk blocks are required for each function
is something I based on received wisdom and BSD documentation,
rather than tracing the code to the kernel. For symlink(2)
this certainly depends on the file system type.
This patch was previously sent to the linux-man mailing list
as an RFC in September 2010.
Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-12-22 17:56:59 +00:00
|
|
|
.B EDQUOT
|
|
|
|
The user's quota of disk blocks or inodes on the file system has been
|
|
|
|
exhausted.
|
|
|
|
.TP
|
2004-11-03 13:51:07 +00:00
|
|
|
.B EEXIST
|
|
|
|
\fIpathname\fP already exists.
|
2008-06-11 15:26:41 +00:00
|
|
|
This includes the case where
|
|
|
|
.I pathname
|
|
|
|
is a symbolic link, dangling or not.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B ENAMETOOLONG
|
|
|
|
Either the total length of \fIpathname\fP is greater than
|
2006-02-12 22:15:41 +00:00
|
|
|
\fBPATH_MAX\fP, or an individual filename component has a length
|
2007-04-12 22:42:49 +00:00
|
|
|
greater than \fBNAME_MAX\fP.
|
|
|
|
In the GNU system, there is no imposed
|
2006-02-12 22:15:41 +00:00
|
|
|
limit on overall filename length, but some file systems may place
|
2004-11-03 13:51:07 +00:00
|
|
|
limits on the length of a component.
|
|
|
|
.TP
|
|
|
|
.B ENOENT
|
|
|
|
A directory component in \fIpathname\fP does not exist or is a
|
|
|
|
dangling symbolic link.
|
|
|
|
.TP
|
|
|
|
.B ENOSPC
|
2008-03-19 07:26:08 +00:00
|
|
|
The directory or file system has no room for the new file.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B ENOTDIR
|
|
|
|
A component used as a directory in \fIpathname\fP is not, in fact, a
|
|
|
|
directory.
|
|
|
|
.TP
|
|
|
|
.B EROFS
|
2008-03-19 07:26:08 +00:00
|
|
|
\fIpathname\fP refers to a read-only file system.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
2006-08-03 13:57:30 +00:00
|
|
|
POSIX.1-2001.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR mkfifo (1),
|
|
|
|
.BR close (2),
|
|
|
|
.BR open (2),
|
|
|
|
.BR read (2),
|
|
|
|
.BR stat (2),
|
|
|
|
.BR umask (2),
|
|
|
|
.BR write (2),
|
2006-04-05 05:34:56 +00:00
|
|
|
.BR mkfifoat (3),
|
2006-04-21 01:46:04 +00:00
|
|
|
.BR fifo (7)
|