d01f4c973d7a4660e5fe1c1953c12e68ffc64dc2
[platform/upstream/gcc48.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 ("syscall.GetErrno");
14 void SetErrno(uintptr_t) asm ("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 }