OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [reent/] [mkdirr.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* 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
20
extern int errno;
21
 
22
/*
23
FUNCTION
24
        <<_mkdir_r>>---Reentrant version of mkdir
25
 
26
INDEX
27
        _mkdir_r
28
 
29
ANSI_SYNOPSIS
30
        #include <reent.h>
31
        int _mkdir_r(struct _reent *<[ptr]>,
32
                     const char *<[path]>, int <[mode]>);
33
 
34
TRAD_SYNOPSIS
35
        #include <reent.h>
36
        int _mkdir_r(<[ptr]>, <[path]>, <[mode]>)
37
        struct _reent *<[ptr]>;
38
        char *<[path]>;
39
        int <[mode]>;
40
 
41
DESCRIPTION
42
        This is a reentrant version of <<mkdir>>.  It
43
        takes a pointer to the global data block, which holds
44
        <<errno>>.
45
*/
46
 
47
int
48
_DEFUN (_mkdir_r, (ptr, path, mode),
49
     struct _reent *ptr _AND
50
     _CONST char *path _AND
51
     int mode)
52
{
53
  int ret;
54
 
55
  errno = 0;
56
  if ((ret = _mkdir (path, mode)) == -1 && errno != 0)
57
    ptr->_errno = errno;
58
  return ret;
59
}
60
 
61
 
62
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.