1 /* @(#)mkfifoat.c	1.3 13/12/26 Copyright 2013 J. Schilling */
2 /*
3  *	Emulate the behavior of mkfifoat(int fd, const char *name, mode_t mode)
4  *
5  *	Note that emulation methods that do not use the /proc filesystem are
6  *	not MT safe. In the non-MT-safe case, we do:
7  *
8  *		savewd()/fchdir()/open(name)/restorewd()
9  *
10  *	Errors may force us to abort the program as our caller is not expected
11  *	to know that we do more than a simple open() here and that the
12  *	working directory may be changed by us.
13  *
14  *	Copyright (c) 2013 J. Schilling
15  */
16 /*
17  * The contents of this file are subject to the terms of the
18  * Common Development and Distribution License, Version 1.0 only
19  * (the "License").  You may not use this file except in compliance
20  * with the License.
21  *
22  * See the file CDDL.Schily.txt in this distribution for details.
23  * A copy of the CDDL is also available via the Internet at
24  * http://www.opensource.org/licenses/cddl1.txt
25  *
26  * When distributing Covered Code, include this CDDL HEADER in each
27  * file and include the License file CDDL.Schily.txt from this distribution.
28  */
29 
30 #include <schily/unistd.h>
31 #include <schily/types.h>
32 #include <schily/fcntl.h>
33 #include <schily/maxpath.h>
34 #include <schily/errno.h>
35 #include <schily/standard.h>
36 #include <schily/schily.h>
37 #include "at-defs.h"
38 
39 #ifndef	HAVE_MKFIFOAT
40 
41 /* CSTYLED */
42 #define	PROTO_DECL	, mode_t mode
43 #define	KR_DECL		mode_t mode;
44 /* CSTYLED */
45 #define	KR_ARGS		, mode
46 #define	FUNC_CALL(n)	mkfifo(n, mode)
47 #define	FLAG_CHECK()
48 #define	FUNC_NAME	mkfifoat
49 #define	FUNC_RESULT	int
50 
51 #include "at-base.c"
52 
53 #endif	/* HAVE_FIFOAT */
54