gcc/libgo/syscalls/sysfile_rtems.go
Ian Lance Taylor 7a9389330e Add Go frontend, libgo library, and Go testsuite.
gcc/:
	* gcc.c (default_compilers): Add entry for ".go".
	* common.opt: Add -static-libgo as a driver option.
	* doc/install.texi (Configuration): Mention libgo as an option for
	--enable-shared.  Mention go as an option for --enable-languages.
	* doc/invoke.texi (Overall Options): Mention .go as a file name
	suffix.  Mention go as a -x option.
	* doc/frontends.texi (G++ and GCC): Mention Go as a supported
	language.
	* doc/sourcebuild.texi (Top Level): Mention libgo.
	* doc/standards.texi (Standards): Add section on Go language.
	Move references for other languages into their own section.
	* doc/contrib.texi (Contributors): Mention that I contributed the
	Go frontend.
gcc/testsuite/:
	* lib/go.exp: New file.
	* lib/go-dg.exp: New file.
	* lib/go-torture.exp: New file.
	* lib/target-supports.exp (check_compile): Match // Go.

From-SVN: r167407
2010-12-03 04:34:57 +00:00

35 lines
1.1 KiB
Go

// sysfile_rtems.go -- RTEMS specific file handling.
// Copyright 2010 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.
// Support for basic Unix file operations. This file simply
// translates from Go data types to Unix data types, and handles
// errno. FIXME: This could probably be done mechanically.
package syscall
const (
OS = "rtems"
// No support for async I/O in RTEMS.
O_ASYNC = 0
)
func libc_pread(fd int, buf *byte, count Size_t, offset Offset_t) Ssize_t __asm__ ("pread")
func libc_pwrite(fd int, buf *byte, count Size_t, offset Offset_t) Ssize_t __asm__ ("pwrite")
func libc_lseek64(int, Offset_t, int) Offset_t __asm__ ("lseek")
func libc_truncate64(path *byte, length Offset_t) int __asm__ ("truncate")
func libc_ftruncate64(fd int, length Offset_t) int __asm__ ("ftruncate")
func libc_nanosleep(req *Timespec, rem *Timespec) int __asm__ ("nanosleep")
func Sleep(nsec int64) (errno int) {
errno = 0
ts := NsecToTimespec(nsec)
r := libc_nanosleep(&ts, nil)
if r < 0 {
errno = GetErrno()
}
return
}