HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- function pstat_getlv
Operating System - HP-UX
1827696
Members
3322
Online
109967
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-15-2001 12:18 PM
08-15-2001 12:18 PM
function pstat_getlv
what the meaning of dev_t in the index parameter (in pstat_getlv function) ?
MDF
Marcelo De Florio
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2001 03:54 PM
08-15-2001 03:54 PM
Re: function pstat_getlv
Hi Marcelo:
Rather than trying to explain, I spent less than 5 minutes throwing together a program which uses pstat_getlv in the context you describe. Normally, pstat_getlv is supplied with a buffer array of some programmer determined number of maximum number of logical volumes to return information about, the element size, the maximum no. the array will hold, and an index of 0. pstat_getlv then populates the buffer array and returns the number of lvols actually loaded.
In this context, however, you do a stat of (e.g.) /dev/vg00/lvol3 to get the st_rdev value
(that's the dev_t you were asking about). You then use that value (cast as an int) as the index value. In this case the buffer need only be able to hold 1 value. You also must set the elemcount value to 0 to tell pstat_getlv that you are operating in this special mode.
Compile this baby program and use it like this:
lvol /dev/vg00/lvol1 /dev/vg01/lvol3 ...
It will then list the node, the major device number (in dec), and the minor device number (in hex). It took me longer to explain this than it did to code the c.
Regards, Clay
Rather than trying to explain, I spent less than 5 minutes throwing together a program which uses pstat_getlv in the context you describe. Normally, pstat_getlv is supplied with a buffer array of some programmer determined number of maximum number of logical volumes to return information about, the element size, the maximum no. the array will hold, and an index of 0. pstat_getlv then populates the buffer array and returns the number of lvols actually loaded.
In this context, however, you do a stat of (e.g.) /dev/vg00/lvol3 to get the st_rdev value
(that's the dev_t you were asking about). You then use that value (cast as an int) as the index value. In this case the buffer need only be able to hold 1 value. You also must set the elemcount value to 0 to tell pstat_getlv that you are operating in this special mode.
Compile this baby program and use it like this:
lvol /dev/vg00/lvol1 /dev/vg01/lvol3 ...
It will then list the node, the major device number (in dec), and the minor device number (in hex). It took me longer to explain this than it did to code the c.
Regards, Clay
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP