OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [go-getgoroot.c] - Blame information for rev 760

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
/* go-getgoroot.c -- getgoroot function for runtime package.
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 <stdlib.h>
8
 
9
#include "go-string.h"
10
 
11
struct __go_string getgoroot (void) asm ("libgo_runtime.runtime.getgoroot");
12
 
13
struct __go_string
14
getgoroot ()
15
{
16
  const char *p;
17
  struct __go_string ret;
18
 
19
  p = getenv ("GOROOT");
20
  ret.__data = (const unsigned char *) p;
21
  if (ret.__data == NULL)
22
    ret.__length = 0;
23
  else
24
    ret.__length = __builtin_strlen (p);
25
  return ret;
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.