source: trunk/libs/newlib/src/newlib/libc/reent/mkdirr.c @ 620

Last change on this file since 620 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.1 KB
Line 
1/* Reentrant versions of mkdir system call. */
2
3#include <reent.h>
4#include <unistd.h>
5#include <_syslist.h>
6
7/* Some targets provides their own versions of this functions.  Those
8   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
9
10#ifdef _REENT_ONLY
11#ifndef REENTRANT_SYSCALLS_PROVIDED
12#define REENTRANT_SYSCALLS_PROVIDED
13#endif
14#endif
15
16#ifndef REENTRANT_SYSCALLS_PROVIDED
17
18/* We use the errno variable used by the system dependent layer.  */
19#undef errno
20extern int errno;
21
22/*
23FUNCTION
24        <<_mkdir_r>>---Reentrant version of mkdir
25       
26INDEX
27        _mkdir_r
28
29SYNOPSIS
30        #include <reent.h>
31        int _mkdir_r(struct _reent *<[ptr]>,
32                     const char *<[path]>, int <[mode]>);
33
34DESCRIPTION
35        This is a reentrant version of <<mkdir>>.  It
36        takes a pointer to the global data block, which holds
37        <<errno>>.
38*/
39
40#include <sys/stat.h>
41
42int
43_mkdir_r (struct _reent *ptr,
44     const char *path,
45     int mode)
46{
47  int ret;
48
49  errno = 0;
50  if ((ret = _mkdir (path, mode)) == -1 && errno != 0)
51    ptr->_errno = errno;
52  return ret;
53}
54
55
56#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
Note: See TracBrowser for help on using the repository browser.