Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 413284 Details for
Bug 553240
dev-util/ninja-1.5.1 fails to build on systems with uclibc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
loadavg() patch working with uclibc (probably any libc anyway)
ninja-1.6.0-uclibc.patch (text/plain), 1.08 KB, created by
Sven E.
on 2015-09-29 18:49:31 UTC
(
hide
)
Description:
loadavg() patch working with uclibc (probably any libc anyway)
Filename:
MIME Type:
Creator:
Sven E.
Created:
2015-09-29 18:49:31 UTC
Size:
1.08 KB
patch
obsolete
>diff -ruN ninja-1.6.0-orig/src/util.cc ninja-1.6.0-new/src/util.cc >--- ninja-1.6.0-orig/src/util.cc 2015-06-29 17:21:30.000000000 +0000 >+++ ninja-1.6.0-new/src/util.cc 2015-09-29 18:25:40.593853286 +0000 >@@ -570,17 +570,30 @@ > } else { > posix_compatible_load = -0.0; > } >- > return posix_compatible_load; > } > #else > double GetLoadAverage() { > double loadavg[3] = { 0.0f, 0.0f, 0.0f }; >+/* loadavg for uclibc on linux, actually works lib independant on all linux... */ >+#if defined(__UCLIBC__) && defined(__linux__) >+ int fh; >+ char fb[16]; >+ if ( (fh=open("/proc/loadavg",O_RDONLY)) !=-1 ){ /* it's a pitty /proc can't be mmapped */ >+ if (read(fh,fb,sizeof(fb)-1)!=-1){ >+ fb[15]='\0'; /* ensure string termination */ >+ loadavg[0]=strtod(fb,NULL); /* nasty but only the first val is used anyway */ >+ } >+ close(fh); >+ } >+#else >+ > if (getloadavg(loadavg, 3) < 0) { > // Maybe we should return an error here or the availability of > // getloadavg(3) should be checked when ninja is configured. > return -0.0f; > } >+#endif > return loadavg[0]; > } > #endif // _WIN32
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 553240
: 413284