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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [syscalls/] [sysopen.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/* connector for open */
2
 
3
#include <reent.h>
4
#include <fcntl.h>
5
 
6
#ifdef _HAVE_STDC
7
 
8
/* The prototype in <fcntl.h> uses ..., so we must correspond.  */
9
 
10
#include <stdarg.h>
11
 
12
int
13
open (const char *file, int flags, ...)
14
{
15
  va_list ap;
16
  int ret;
17
 
18
  va_start (ap, flags);
19
#ifdef REENTRANT_SYSCALLS_PROVIDED
20
  ret = _open_r (_REENT, file, flags, va_arg (ap, int));
21
#else
22
  ret = _open (file, flags, va_arg (ap, int));
23
#endif
24
  va_end (ap);
25
  return ret;
26
}
27
 
28
#else /* ! _HAVE_STDC */
29
 
30
int
31
open (file, flags, mode)
32
     const char *file;
33
     int flags;
34
     int mode;
35
{
36
#ifdef REENTRANT_SYSCALLS_PROVIDED
37
  return _open_r (_REENT, file, flags, mode);
38
#else
39
  return _open (file, flags, mode);
40
#endif
41
}
42
 
43
#endif /* ! _HAVE_STDC */

powered by: WebSVN 2.1.0

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