Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sysopen.c « syscalls « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b3836f246e76904dbfa880ace47b39688222f52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* connector for open */

#include <reent.h>
#include <fcntl.h>

#ifdef _HAVE_STDC

/* The prototype in <fcntl.h> uses ..., so we must correspond.  */

#include <stdarg.h>

int
open (const char *file, int flags, ...)
{
  va_list ap;
  int ret;

  va_start (ap, flags);
#ifdef REENTRANT_SYSCALLS_PROVIDED
  ret = _open_r (_REENT, file, flags, va_arg (ap, int));
#else
  ret = _open (file, flags, va_arg (ap, int));
#endif
  va_end (ap);
  return ret;
}

#else /* ! _HAVE_STDC */

int 
open (file, flags, mode)
     const char *file;
     int flags;
     int mode;
{
#ifdef REENTRANT_SYSCALLS_PROVIDED
  return _open_r (_REENT, file, flags, mode);
#else
  return _open (file, flags, mode);
#endif
}

#endif /* ! _HAVE_STDC */