Project

General

Profile

Actions

Bug #9021

open

sys/loadavg.h is not self-contained

Added by Bruno Haible over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2018-02-03
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

In OpenIndiana hipster, the include file <sys/loadavg.h> is not self-contained.

How to reproduce:

==================== foo.c =================
#include <sys/loadavg.h>
=========================================
$ gcc -c foo.c
In file included from foo.c:1:0:
/usr/include/sys/loadavg.h:47:2: error: unknown type name 'hrtime_t'
  hrtime_t lg_total; /* used to temporarily hold load totals */
  ^~~~~~~~
/usr/include/sys/loadavg.h:48:2: error: unknown type name 'hrtime_t'
  hrtime_t lg_loads[S_LOADAVG_SZ]; /* table of recorded entries */
  ^~~~~~~~

Note: This is a regression compared to Oracle Solaris: In Solaris 11.3, this works fine.


Related issues

Related to illumos gate - Bug #5100: sparc build failed after 5004ClosedIgor Kozhukhov2014-08-17

Actions
Actions #1

Updated by Bruno Haible over 4 years ago

The fix is probably to add a
#include <sys/time.h>
statement near the top of /usr/include/sys/loadavg.h.

Actions #2

Updated by Alexander Pyhalov over 4 years ago

  • Project changed from OpenIndiana Distribution to illumos gate
Actions #3

Updated by Yuri Pankov over 4 years ago

  • Description updated (diff)

Indeed it's a regression introduced in #5100, I don't see why that struct has to be in the header at all.

Actions #4

Updated by Yuri Pankov over 4 years ago

  • Related to Bug #5100: sparc build failed after 5004 added
Actions

Also available in: Atom PDF