Added loadavg collector for solaris

It seems solaris prefers "sys/loadavg.h" over "stdlib.h" when
fetching the load average.

For Illumos based OSes it was required to include "sys/time.h" to
ensure that "hrtime_t" was defined.

https://www.illumos.org/issues/6002

It also required setting the ldflags "-fno-stack-protector -lssp" to
avoid undefined symbols when linking with gcc.

/opt/local/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
Undefined                       first referenced
 symbol                             in file
 __stack_chk_fail                    /tmp/go-link-138622936/000002.o
 __stack_chk_guard                   /tmp/go-link-138622936/000002.o
This commit is contained in:
Kevin Pettijohn 2016-09-18 19:03:59 -07:00
commit d2fbeeb3c3
2 changed files with 41 additions and 1 deletions

View file

@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build darwin dragonfly netbsd openbsd solaris
// +build darwin dragonfly netbsd openbsd
// +build !noloadavg
package collector