The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lvm_queryvg call does not work properly and results in a sudden memory rise. sandiworld AIX 0 11-15-2007 01:57 AM
my case statement doesn't work.. sureshy UNIX for Dummies Questions & Answers 7 10-25-2002 03:25 PM
unmount doesn't work DISTURBED UNIX for Dummies Questions & Answers 2 07-04-2002 07:14 PM
Repquota doesn't work as Cronjob?!? b416 UNIX for Dummies Questions & Answers 1 04-14-2002 09:44 PM
why doesn't this work????? token High Level Programming 1 09-20-2001 11:08 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-15-2007
sandiworld sandiworld is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 4
pstat_getdisk() call doesn’t work properly in HPUX 11.31 (11i V3)

As per the man page, pstat_getdisk() call returns the number of instances, which could be 0 upon successful completion, otherwise a value of -1 is returned.

Please have a look at this sample program ->

#include <stdio.h>
#include <sys/pstat.h>

int main()
{
int j = 0, ret;
struct pst_diskinfo sDiskData;

while(1)
{
ret = pstat_getdisk(&sDiskData, sizeof(sDiskData), 1, j);
if(ret<0)
{
printf("\nReturned with code %d \n",ret);
break;
}
printf("\n Ret Code : %d , Device Name : %s%d",ret,sDiskData.psd_drv_name.psd_name,sDiskData.psd_instance);
j++;
}
return 0;
}

On HP-UX 11.11 and 11.23, the call pstat_getdisk() returns series of ‘1’s then single ‘0’ and finally ‘-1’ and the program terminates successfully.

On HP-UX 11.31 the call pstat_getdisk() returns series of ‘1’s followed by series of ‘0’s and never returns ‘-1’, so the same program never terminates.

The workaround would be to replace the condition
if(ret<0)
with
if(ret==0)

But, will this call always returns ‘1’s followed by ‘0’s or there can be a case in which the call will return ‘0’ in between?

In another way, can we get an invalid index in between or all the valid disks are in sequence only?

Last edited by sandiworld; 10-25-2007 at 11:32 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0