Retro68/gcc/libgo/go/syscall/errno.c

28 lines
640 B
C
Raw Normal View History

2012-03-27 23:13:14 +00:00
/* errno.c -- functions for getting and setting errno
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. */
#include <errno.h>
#include <stdint.h>
2014-09-21 17:33:12 +00:00
#include "runtime.h"
2012-03-27 23:13:14 +00:00
/* errno is typically a macro. These functions set
and get errno specific to the libc being used. */
2018-12-28 15:30:48 +00:00
uintptr_t GetErrno(void) __asm__ (GOSYM_PREFIX "syscall.GetErrno");
2014-09-21 17:33:12 +00:00
void SetErrno(uintptr_t) __asm__ (GOSYM_PREFIX "syscall.SetErrno");
2012-03-27 23:13:14 +00:00
uintptr_t
2018-12-28 15:30:48 +00:00
GetErrno(void)
2012-03-27 23:13:14 +00:00
{
return (uintptr_t) errno;
}
void
SetErrno(uintptr_t value)
{
errno = (int) value;
}