2016-08-05 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libgo / go / syscall / errno.c
blob5cdc7730445e9ab933dc4b32c4e45cbdfe2f0ede
1 /* errno.c -- functions for getting and setting errno
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 #include <errno.h>
7 #include <stdint.h>
9 #include "runtime.h"
11 /* errno is typically a macro. These functions set
12 and get errno specific to the libc being used. */
14 uintptr_t GetErrno() __asm__ (GOSYM_PREFIX "syscall.GetErrno");
15 void SetErrno(uintptr_t) __asm__ (GOSYM_PREFIX "syscall.SetErrno");
17 uintptr_t
18 GetErrno()
20 return (uintptr_t) errno;
23 void
24 SetErrno(uintptr_t value)
26 errno = (int) value;