sysinfo is inconsistent - int or long??
According to the sysinfo(2) man page, sysinfo() returns a long. But the
header file shows it returning an int.
Is this a bug? If so is the header or man page wrong?
-bash-3.2$ cat /etc/release
Solaris Express Developer Edition 1/08 snv_79b X86
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 24 January 2008
-bash-3.2$ man sysinfo
Reformatting page. Please Wait... done
System Calls sysinfo(2)
NAME
sysinfo - get and set system information strings
SYNOPSIS
#include <sys/systeminfo.h>
long sysinfo(int command, char *buf, long count);
-bash-3.2$ grep sysinfo /usr/include/sys/systeminfo.h
* Commands to sysinfo(2)
* Values for sysinfo(2) commands are to be assigned by the following
int sysinfo(int, char *, long);
int sysinfo();
Re: sysinfo is inconsistent - int or long??
Dave wrote:[color=blue]
> According to the sysinfo(2) man page, sysinfo() returns a long. But the
> header file shows it returning an int.
>
> Is this a bug? If so is the header or man page wrong?
>[/color]
I'd file a bug against the man page. The code doesn't lie!
--
Ian Collins.
Re: sysinfo is inconsistent - int or long??
Ian Collins wrote:[color=blue]
> Dave wrote:[color=green]
>> According to the sysinfo(2) man page, sysinfo() returns a long. But the
>> header file shows it returning an int.
>>
>> Is this a bug? If so is the header or man page wrong?
>>[/color]
> I'd file a bug against the man page. The code doesn't lie!
>[/color]
Cheers, I will do that. I will look up first whether POSIX defines this
as returning a long or int (if it is defined anyway).
Re: sysinfo is inconsistent - int or long??
Dave wrote:[color=blue]
> Ian Collins wrote:[color=green]
>> Dave wrote:[color=darkred]
>>> According to the sysinfo(2) man page, sysinfo() returns a long. But the
>>> header file shows it returning an int.
>>>
>>> Is this a bug? If so is the header or man page wrong?
>>>[/color]
>> I'd file a bug against the man page. The code doesn't lie!
>>[/color]
>
>
> Cheers, I will do that. I will look up first whether POSIX defines this
> as returning a long or int (if it is defined anyway).[/color]
I've now done this on the opensolaris bug database. Of course, I have no
idea of a bug id, since one is not generated. That in itself seems a
bug, as it difficult to track bugs when one does not know the bug id.
Re: sysinfo is inconsistent - int or long??
Andrew Gabriel wrote:[color=blue]
> In article <48049f97@212.67.96.135>,
> Dave <foo@coo.com> writes:[color=green]
>> Dave wrote:[color=darkred]
>>> Ian Collins wrote:
>>>> Dave wrote:
>>>>> According to the sysinfo(2) man page, sysinfo() returns a long. But the
>>>>> header file shows it returning an int.
>>>>>
>>>>> Is this a bug? If so is the header or man page wrong?
>>>>>
>>>> I'd file a bug against the man page. The code doesn't lie!
>>>>
>>>
>>> Cheers, I will do that. I will look up first whether POSIX defines this
>>> as returning a long or int (if it is defined anyway).[/color]
>> I've now done this on the opensolaris bug database. Of course, I have no
>> idea of a bug id, since one is not generated. That in itself seems a
>> bug, as it difficult to track bugs when one does not know the bug id.[/color]
>
> You will be mailed the bugid when it's entered into the bug
> database, usually within a day or so.
>[/color]
Once before over a WiFi bug I had a hassle tracking the bug id - I never
received it by email. Much later some sent it to me after I made enquiries.
Today I submitted this bug about the long/int issue, got a bug id within
a couple of hours, and it has now been fixed!!! Fixed within 6 hours or
so of me reporting it. Pretty impressive - see below. Of course, it only
required the change of one word, but I was quite impressed none the less.
Dave
------
*Synopsis*: sysinfo(2) man page says sysinfo() returns 'long'. But it
should be int.
Due to a change requested by <User 1-5Q-12752>,
<User 1-5Q-12752> is now the responsible engineer for:
CR 6688607 changed on Apr 15 2008 by <User 1-5Q-12752>
=== Field ============ === New Value ============= === Old Value
=============
Commit to Fix in Build snv_88
Evaluation New Note
Fixed in Build snv_88
Integrated in Build snv_88
Responsible Engineer <User 1-5Q-12752>
Status 10-Fix Delivered 1-Dispatched
Targeted Release solaris_nevada
====================== ===========================
===========================
*Change Request ID*: 6688607
*Synopsis*: sysinfo(2) man page says sysinfo() returns 'long'. But it
should be int.
Product: solaris
Category: manpage
Subcategory: section2
Type: Defect
Subtype:
Status: 10-Fix Delivered
Substatus:
Priority: 4-Low
Introduced In Release:
Introduced In Build:
Responsible Engineer: <User 1-5Q-12752>
Keywords: opensolaris
=== *Description*
============================================================
Category
manpage
Sub-Category
section2
Description
Both systems have a man page for sysinfo which looks like this,
saying sysinfo() returns a long.
System Calls sysinfo(2)
NAME
sysinfo - get and set system information strings
SYNOPSIS
#include <sys/systeminfo.h>
long sysinfo(int command, char *buf, long count);
DESCRIPTION
The sysinfo() function copies information relating to the
BUT The header file (/usr/include/sys/systeminfo.h) shows that sysinfo
returns an integer and not a long.
bash-3.2$ grep sysinfo /usr/include/sys/systeminfo.h
* Commands to sysinfo(2)
* Values for sysinfo(2) commands are to be assigned by the following
int sysinfo(int, char *, long);
int sysinfo();
bash-3.2$
Frequency
Always
Regression
No
Steps to Reproduce
bash-3.2$ man sysinfo
then compare with
bash-3.2$ grep sysinfo /usr/include/sys/systeminfo.h
Expected Result
int sysinfo(int command, char *buf, long count);
Actual Result
long sysinfo(int command, char *buf, long count);
Error Message(s)
None
Test Case
No need. Just run 'man' and 'grep'
I first noticed this when I had a compiler warning.
Workaround
Ignore the man page and assume sysinfo() returns int.
Submitter wants to work on bug
Yes
Additional configuration information
I've noticed this issue both on Solaris 10 update 4 (SPARC) and SXDE
for x86 (1/08, snv79).
*** (#1 of 1): 2008-04-15 09:19:36 GMT+00:00 <User 1-F4SZV>
=== *Workaround*
=============================================================
=== *Additional Details*
=====================================================
Targeted Release: solaris_nevada
Commit To Fix In Build: snv_88
Fixed In Build: snv_88
Integrated In Build: snv_88
Verified In Build:
See Also:
Duplicate of:
Hooks:
Hook1:
Hook2:
Hook3:
Hook4:
Hook5:
Hook6: <email address omitted>
Program Management:
Root Cause:
Fix Affects Documentation: No
Fix Affects Localization: No
=== *History*
================================================================
Date Submitted: 2008-04-15 09:19:35 GMT+00:00
Submitted By: <User 1-F4SZV>
Status Changed Date Updated Updated By
10-Fix Delivered 2008-04-15 17:05:13 GMT+00:00 <User 1-5Q-12752>
=== *Service Request*
========================================================
Impact: Limited
Functionality: Secondary
Severity: 4
Product Name: solaris
Product Release: solaris_nevada
Product Build: snv_79
Operating System: solaris_nevada
Hardware: generic
Submitted Date: 2008-04-15 09:19:36 GMT+00:00
=== *Service Request*
========================================================
Impact: Limited
Functionality: Secondary
Severity: 4
Product Name: solaris
Product Release: solaris_10u4
Product Build:
Operating System: solaris
Hardware: generic
Submitted Date: 2008-04-15 15:43:57 GMT+00:00
=== *Multiple Release (MR) Cluster* - 0
======================================