Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: third_party/go/src/golang.org/x/mobile/app/android_x86.c

Issue 1275153002: Remove third_party/golang.org/x/mobile as it is no longer used with Go 1.5. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove golang.org/x/mobile Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build android,x86
6
7 #include <android/log.h>
8 #include <dlfcn.h>
9 #include <errno.h>
10 #include <fcntl.h>
11 #include <stdlib.h>
12 #include <stdint.h>
13 #include <string.h>
14 #include "_cgo_export.h"
15
16 void build_auxv(uint32_t *xauxv, size_t xauxv_len) {
17 char* auxv = (char*)xauxv;
18 size_t auxv_len = xauxv_len*sizeof(uint32_t);
19
20 // TODO(crawshaw): determine if we can read /proc/self/auxv on
21 // x86 android release builds.
22 int fd = open("/proc/self/auxv", O_RDONLY, 0);
23 if (fd == -1) {
24 __android_log_print(ANDROID_LOG_FATAL, "Go", "cannot open /proc/ self/auxv: %s", strerror(errno));
25 }
26 int n = read(fd, &auxv, auxv_len);
27 if (n < 0) {
28 __android_log_print(ANDROID_LOG_FATAL, "Go", "error reading /pro c/self/auxv: %s", strerror(errno));
29 }
30 if (n == auxv_len) { // auxv should be more than plenty.
31 __android_log_print(ANDROID_LOG_FATAL, "Go", "/proc/self/auxv to o big");
32 }
33 close(fd);
34
35 for (; n < auxv_len; n++) {
36 auxv[n] = 0;
37 }
38 }
OLDNEW
« no previous file with comments | « third_party/go/src/golang.org/x/mobile/app/android_arm.c ('k') | third_party/go/src/golang.org/x/mobile/app/app.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698