aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgo/runtime/go-varargs.c
blob: 682c08d64d4d11822a752c41e833b57c28ba684c (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
44
45
46
47
/* go-varargs.c -- functions for calling C varargs functions.

   Copyright 2013 The Go Authors. All rights reserved.
   Use of this source code is governed by a BSD-style
   license that can be found in the LICENSE file.  */

#include "config.h"

#include <sys/types.h>
#include <fcntl.h>

/* The syscall package calls C functions.  The Go compiler can not
   represent a C varargs functions.  On some systems it's important
   that the declaration of a function match the call.  This function
   holds non-varargs C functions that the Go code can call.  */

int
__go_open (char *path, int mode, mode_t perm)
{
  return open (path, mode, perm);
}

int
__go_fcntl (int fd, int cmd, int arg)
{
  return fcntl (fd, cmd, arg);
}

#ifdef HAVE_OPEN64

int
__go_open64 (char *path, int mode, mode_t perm)
{
  return open64 (path, mode, perm);
}

#endif

#ifdef HAVE_OPENAT

int
__go_openat (int fd, char *path, int flags, mode_t mode)
{
  return openat (fd, path, flags, mode);
}

#endif