- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: pstat_getdisk() call doesn’t work properly in ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 11:19 PM
10-22-2007 11:19 PM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
When the return value is not the size requested, then it means the end of the list had been reached.
This MUST be the real end loop test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2007 11:41 PM
10-22-2007 11:41 PM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
{
ret = pstat_getdisk(&sDiskData[0], sizeof(sDiskData[0]), SDISKTABSIZE, j);
if(ret<0)
{
perror("erreur");
printf("\nReturned with code %d with j=%d\n",ret,j);
break;
}
/* Process the data */
....
/* */
if(ret!=SDISKTABSIZE) break;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2007 01:33 AM
10-23-2007 01:33 AM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
I think 'sandiworld' agrees that the program should stop when 0 is returned, as you indicated in your first reply.
The original problem, which was believed to be correct, is now in fact proven to be broken. It only seemed to work.
The question then became why does 1 element work differently from more than 1 (since 11.31). Surely that's more curiosity than an serious question.
I just looked at it again, and it turns out that the difference is even more subbtle.
When pstat_getdisk is called in a loop, with ever increasing index, then it returns 0 indicating nothing was returned once the index is beyond the number of instances.
It is seen as asking for 'next' not a specific instance.
When it is called with an index not one higher that the prior, and larger than the number of instances, then the return code equals the index specified minus the actual number of instances.
So when we use more than 1 element to return, the program seen not seen asking for next but seen as askign for a specific start point returning the negtive value if the start point is beyond max instances. So that's the difference between 1 and more than 1
I would suggest, but don't really care, that in the case of an index larger than the number of instances the function should perhaps always return -1, not a variable number, and set errno to 22 (EINVAL).
Does anybody have idea why pstat_getdisk() call works with 2 elements and does not work with 1 element for HPUX 11.31?
Dennis>> It works perfectly fine on 11.31. You need to stop your loop on <= 0.
:
Returned with code 0
Right... but supposedly that's different from how the older versions worked. The woudl eventually return a negative number. 11.31 keeps returning 0. That's not bad, just different.
>>Hein: i, i, ret,sDiskData...
>That should be: j, i, ...
Of course. Sorry.
Cheers!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2007 02:18 AM
10-23-2007 02:18 AM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
Even on 11.23 the first failing get returns 0.
only the next one is failing with an error.
The difference of behavior is just out of spec.
It is in a grey zone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2007 03:55 AM
10-23-2007 03:55 AM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
So it is for sure that pstat_getdisk() always returns 0 at the end of the list only and not in between. Am I right ?
Is this always a guaranteed operation and we can break the loop on <= 0 condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2007 04:15 AM
10-23-2007 04:15 AM
Re: pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)
even on 11.23 and before
- « Previous
-
- 1
- 2
- Next »