OSDN Git Service

syscall: Additional constants, some type corrections.
[pf3gnuchains/gcc-fork.git] / libgo / go / syscall / errno.c
1 /* errno.c -- functions for getting and setting errno
2
3    Copyright 2010 The Go Authors. All rights reserved.
4    Use of this source code is governed by a BSD-style
5    license that can be found in the LICENSE file.  */
6
7 #include <errno.h>
8 #include <stdint.h>
9
10 /* errno is typically a macro. These functions set 
11    and get errno specific to the libc being used.  */
12
13 uintptr_t GetErrno() asm ("libgo_syscall.syscall.GetErrno");
14 void SetErrno(uintptr_t) asm ("libgo_syscall.syscall.SetErrno");
15
16 uintptr_t
17 GetErrno()
18 {
19   return (uintptr_t) errno;
20 }
21
22 void
23 SetErrno(uintptr_t value)
24 {
25   errno = (int) value;
26 }