Commit e02ed81e by Ian Lance Taylor

libgo: Build stubs for some syscall functions not on older systems.

From-SVN: r183577
parent 0c2f0102
......@@ -449,6 +449,7 @@ runtime_files = \
runtime/go-now.c \
runtime/go-new-map.c \
runtime/go-new.c \
runtime/go-nosys.c \
runtime/go-panic.c \
runtime/go-print.c \
runtime/go-recover.c \
......
......@@ -201,8 +201,8 @@ am__libgo_la_SOURCES_DIST = runtime/go-append.c runtime/go-assert.c \
runtime/go-map-delete.c runtime/go-map-index.c \
runtime/go-map-len.c runtime/go-map-range.c \
runtime/go-nanotime.c runtime/go-now.c runtime/go-new-map.c \
runtime/go-new.c runtime/go-panic.c runtime/go-print.c \
runtime/go-recover.c runtime/go-reflect.c \
runtime/go-new.c runtime/go-nosys.c runtime/go-panic.c \
runtime/go-print.c runtime/go-recover.c runtime/go-reflect.c \
runtime/go-reflect-call.c runtime/go-reflect-map.c \
runtime/go-rune.c runtime/go-runtime-error.c \
runtime/go-setenv.c runtime/go-signal.c runtime/go-strcmp.c \
......@@ -239,8 +239,8 @@ am__objects_4 = go-append.lo go-assert.lo go-assert-interface.lo \
go-interface-compare.lo go-interface-eface-compare.lo \
go-interface-val-compare.lo go-make-slice.lo go-map-delete.lo \
go-map-index.lo go-map-len.lo go-map-range.lo go-nanotime.lo \
go-now.lo go-new-map.lo go-new.lo go-panic.lo go-print.lo \
go-recover.lo go-reflect.lo go-reflect-call.lo \
go-now.lo go-new-map.lo go-new.lo go-nosys.lo go-panic.lo \
go-print.lo go-recover.lo go-reflect.lo go-reflect-call.lo \
go-reflect-map.lo go-rune.lo go-runtime-error.lo go-setenv.lo \
go-signal.lo go-strcmp.lo go-string-to-byte-array.lo \
go-string-to-int-array.lo go-strplus.lo go-strslice.lo \
......@@ -872,6 +872,7 @@ runtime_files = \
runtime/go-now.c \
runtime/go-new-map.c \
runtime/go-new.c \
runtime/go-nosys.c \
runtime/go-panic.c \
runtime/go-print.c \
runtime/go-recover.c \
......@@ -2551,6 +2552,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-nanotime.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-new-map.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-new.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-nosys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-now.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-panic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-print.Plo@am__quote@
......@@ -2863,6 +2865,13 @@ go-new.lo: runtime/go-new.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-new.lo `test -f 'runtime/go-new.c' || echo '$(srcdir)/'`runtime/go-new.c
go-nosys.lo: runtime/go-nosys.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-nosys.lo -MD -MP -MF $(DEPDIR)/go-nosys.Tpo -c -o go-nosys.lo `test -f 'runtime/go-nosys.c' || echo '$(srcdir)/'`runtime/go-nosys.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-nosys.Tpo $(DEPDIR)/go-nosys.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime/go-nosys.c' object='go-nosys.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-nosys.lo `test -f 'runtime/go-nosys.c' || echo '$(srcdir)/'`runtime/go-nosys.c
go-panic.lo: runtime/go-panic.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-panic.lo -MD -MP -MF $(DEPDIR)/go-panic.Tpo -c -o go-panic.lo `test -f 'runtime/go-panic.c' || echo '$(srcdir)/'`runtime/go-panic.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/go-panic.Tpo $(DEPDIR)/go-panic.Plo
......
......@@ -6,9 +6,33 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `epoll_create1' function. */
#undef HAVE_EPOLL_CREATE1
/* Define to 1 if you have the `faccessat' function. */
#undef HAVE_FACCESSAT
/* Define to 1 if you have the `fchmodat' function. */
#undef HAVE_FCHMODAT
/* Define to 1 if you have the `fchownat' function. */
#undef HAVE_FCHOWNAT
/* Define to 1 if you have the `futimesat' function. */
#undef HAVE_FUTIMESAT
/* Define if _Unwind_GetIPInfo is available. */
#undef HAVE_GETIPINFO
/* Define to 1 if you have the `inotify_add_watch' function. */
#undef HAVE_INOTIFY_ADD_WATCH
/* Define to 1 if you have the `inotify_init' function. */
#undef HAVE_INOTIFY_INIT
/* Define to 1 if you have the `inotify_rm_watch' function. */
#undef HAVE_INOTIFY_RM_WATCH
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
......@@ -21,24 +45,42 @@
/* Define to 1 if you have the <linux/rtnetlink.h> header file. */
#undef HAVE_LINUX_RTNETLINK_H
/* Define to 1 if the system has the type `loff_t'. */
#undef HAVE_LOFF_T
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mincore' function. */
#undef HAVE_MINCORE
/* Define to 1 if you have the `mkdirat' function. */
#undef HAVE_MKDIRAT
/* Define to 1 if you have the `mknodat' function. */
#undef HAVE_MKNODAT
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if the system has the type `off64_t'. */
#undef HAVE_OFF64_T
/* Define to 1 if you have the `openat' function. */
#undef HAVE_OPENAT
/* Define to 1 if you have the `renameat' function. */
#undef HAVE_RENAMEAT
/* Define to 1 if you have the `sem_timedwait' function. */
#undef HAVE_SEM_TIMEDWAIT
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define to 1 if you have the `splice' function. */
#undef HAVE_SPLICE
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
......@@ -101,9 +143,18 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the `tee' function. */
#undef HAVE_TEE
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `unlinkat' function. */
#undef HAVE_UNLINKAT
/* Define to 1 if you have the `unshare' function. */
#undef HAVE_UNSHARE
/* Define to 1 if you have the `wait4' function. */
#undef HAVE_WAIT4
......
......@@ -33,6 +33,8 @@ AC_SUBST(CFLAGS)
AM_MAINTAINER_MODE
AC_INCLUDES_DEFAULT
AC_PROG_LD
AC_PROG_RANLIB
AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
......@@ -465,6 +467,9 @@ AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv)
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
AC_CHECK_FUNCS(epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)
AC_CHECK_TYPES([loff_t])
CFLAGS_hold="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS_hold="$LIBS"
......@@ -519,7 +524,7 @@ AC_SUBST(STRINGOPS_FLAG)
CFLAGS_hold=$CFLAGS
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
AC_CHECK_TYPES(off64_t)
AC_CHECK_TYPES([off64_t])
CFLAGS=$CFLAGS_hold
dnl Work out the size of the epoll_events struct on GNU/Linux.
......
/* go-nosys.c -- functions missing from system.
Copyright 2012 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. */
/* This file exists to provide definitions for functions that are
missing from libc, according to the configure script. This permits
the Go syscall package to not worry about whether the functions
exist or not. */
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#ifndef HAVE_OFF64_T
typedef signed int off64_t __attribute__ ((mode (DI)));
#endif
#ifndef HAVE_LOFF_T
typedef off64_t loff_t;
#endif
#ifndef HAVE_EPOLL_CREATE1
int
epoll_create1 (int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_FACCESSAT
int
faccessat (int fd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
int mode __attribute__ ((unused)),
int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_FCHMODAT
int
fchmodat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
mode_t mode __attribute__ ((unused)),
int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_FCHOWNAT
int
fchownat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
uid_t owner __attribute__ ((unused)),
gid_t group __attribute__ ((unused)),
int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_FUTIMESAT
int
futimesat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
const struct timeval times[2] __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_INOTIFY_ADD_WATCH
int
inotify_add_watch (int fd __attribute__ ((unused)),
const char* pathname __attribute__ ((unused)),
uint32_t mask __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_INOTIFY_INIT
int
inotify_init (void)
{
return ENOSYS;
}
#endif
#ifndef HAVE_INOTIFY_RM_WATCH
int
inotify_rm_watch (int fd __attribute__ ((unused)),
uint32_t wd __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_MKDIRAT
int
mkdirat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
mode_t mode __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_MKNODAT
int
mknodat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
mode_t mode __attribute__ ((unused)),
dev_t dev __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_OPENAT
int
openat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
int oflag __attribute__ ((unused)),
...)
{
return ENOSYS;
}
#endif
#ifndef HAVE_RENAMEAT
int
renameat (int olddirfd __attribute__ ((unused)),
const char *oldpath __attribute__ ((unused)),
int newdirfd __attribute__ ((unused)),
const char *newpath __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_SPLICE
int
splice (int fd __attribute__ ((unused)),
loff_t *off_in __attribute__ ((unused)),
int fd_out __attribute__ ((unused)),
loff_t *off_out __attribute__ ((unused)),
size_t len __attribute__ ((unused)),
unsigned int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_TEE
int
tee (int fd_in __attribute__ ((unused)),
int fd_out __attribute__ ((unused)),
size_t len __attribute__ ((unused)),
unsigned int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_UNLINKAT
int
unlinkat (int dirfd __attribute__ ((unused)),
const char *pathname __attribute__ ((unused)),
int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
#ifndef HAVE_UNSHARE
int
unshare (int flags __attribute__ ((unused)))
{
return ENOSYS;
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment