1 /* go-getgoroot.c -- getgoroot function for runtime package.
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. */
11 struct __go_string
getgoroot (void) asm ("libgo_runtime.runtime.getgoroot");
17 struct __go_string ret
;
19 p
= getenv ("GOROOT");
20 ret
.__data
= (const unsigned char *) p
;
21 if (ret
.__data
== NULL
)
24 ret
.__length
= __builtin_strlen (p
);