xref: /titanic_52/usr/src/lib/libc/port/sys/mkdir.c (revision 794f0adb050e571bbfde4d2a19b9f88b852079dd)
1*794f0adbSRoger A. Faulkner /*
2*794f0adbSRoger A. Faulkner  * CDDL HEADER START
3*794f0adbSRoger A. Faulkner  *
4*794f0adbSRoger A. Faulkner  * The contents of this file are subject to the terms of the
5*794f0adbSRoger A. Faulkner  * Common Development and Distribution License (the "License").
6*794f0adbSRoger A. Faulkner  * You may not use this file except in compliance with the License.
7*794f0adbSRoger A. Faulkner  *
8*794f0adbSRoger A. Faulkner  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*794f0adbSRoger A. Faulkner  * or http://www.opensolaris.org/os/licensing.
10*794f0adbSRoger A. Faulkner  * See the License for the specific language governing permissions
11*794f0adbSRoger A. Faulkner  * and limitations under the License.
12*794f0adbSRoger A. Faulkner  *
13*794f0adbSRoger A. Faulkner  * When distributing Covered Code, include this CDDL HEADER in each
14*794f0adbSRoger A. Faulkner  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*794f0adbSRoger A. Faulkner  * If applicable, add the following below this CDDL HEADER, with the
16*794f0adbSRoger A. Faulkner  * fields enclosed by brackets "[]" replaced with your own identifying
17*794f0adbSRoger A. Faulkner  * information: Portions Copyright [yyyy] [name of copyright owner]
18*794f0adbSRoger A. Faulkner  *
19*794f0adbSRoger A. Faulkner  * CDDL HEADER END
20*794f0adbSRoger A. Faulkner  */
21*794f0adbSRoger A. Faulkner 
22*794f0adbSRoger A. Faulkner /*
23*794f0adbSRoger A. Faulkner  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24*794f0adbSRoger A. Faulkner  */
25*794f0adbSRoger A. Faulkner 
26*794f0adbSRoger A. Faulkner #include "lint.h"
27*794f0adbSRoger A. Faulkner #include <sys/syscall.h>
28*794f0adbSRoger A. Faulkner #include <sys/stat.h>
29*794f0adbSRoger A. Faulkner #include <sys/fcntl.h>
30*794f0adbSRoger A. Faulkner 
31*794f0adbSRoger A. Faulkner int
32*794f0adbSRoger A. Faulkner mkdirat(int fd, const char *path, mode_t mode)
33*794f0adbSRoger A. Faulkner {
34*794f0adbSRoger A. Faulkner 	return (syscall(SYS_mkdirat, fd, path, mode));
35*794f0adbSRoger A. Faulkner }
36*794f0adbSRoger A. Faulkner 
37*794f0adbSRoger A. Faulkner #pragma weak _mkdir = mkdir
38*794f0adbSRoger A. Faulkner int
39*794f0adbSRoger A. Faulkner mkdir(const char *path, mode_t mode)
40*794f0adbSRoger A. Faulkner {
41*794f0adbSRoger A. Faulkner #if defined(_RETAIN_OLD_SYSCALLS)
42*794f0adbSRoger A. Faulkner 	return (syscall(SYS_mkdir, path, mode));
43*794f0adbSRoger A. Faulkner #else
44*794f0adbSRoger A. Faulkner 	return (mkdirat(AT_FDCWD, path, mode));
45*794f0adbSRoger A. Faulkner #endif
46*794f0adbSRoger A. Faulkner }
47