HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: CS_PARTITION_IDENT
Operating System - HP-UX
1830979
Members
2015
Online
110018
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
03-04-2003 07:29 AM
03-04-2003 07:29 AM
CS_PARTITION_IDENT
Hello,
I tried to find the structure of the field CS_PARTITION_IDENT used in getconf but I found nothing.
The only thing I have is that CS_PARTITION_IDENT is an opaque string of printable ascii characters not to exceed 64 bytes including the string terminator.
Somebody know the maximum lenght of this field ?
Regards,
Lionel
I tried to find the structure of the field CS_PARTITION_IDENT used in getconf but I found nothing.
The only thing I have is that CS_PARTITION_IDENT is an opaque string of printable ascii characters not to exceed 64 bytes including the string terminator.
Somebody know the maximum lenght of this field ?
Regards,
Lionel
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 08:03 AM
03-05-2003 08:03 AM
Re: CS_PARTITION_IDENT
Well, I don't know where you got that information above (opaque string of printable ascii characters not to exceed 64 bytes including the string terminator), but if you read it - it means that it is a character string 64 bytes long, with a null terminator at the end. This means you have up to 63 bytes you can put into it, and you must make sure that an 8 bit value of zero is the very last thing at the end of your string. Funny though, I don't find that CS_PARTITION_IDENT is a string. Grep'ing through the /usr/conf/sys/*.h files, I found the following definition:
# define _CS_PARTITION_IDENT 10004 /* Partition Identifier */
This is in the unistd.h file, under a section titled:
/* Symbolic constants for confstr() defined by HP-UX: 10000-19999 */
Going a little further with this, a man on confstr() yields:
DESCRIPTION
confstr() provides a method for applications to get configuration-
defined string values. Its use and purpose are similar to sysconf()
(see sysconf(2)), except that it is used where string values rather
than numeric values are returned.
The function prototype to confstr is:
size_t confstr(int name, char *buf, size_t len);
The first argument "name" is actually an integer, and that's where you would pass the value "_CS_PARTITION_IDENT" which will be replaced with the value 10004 (by the precompiler). The next argument will return to YOU a pointer to buffer already malloc'd for you, and the last argument (len) will return you a length of how long the string is.
I hope I went the right direction with this information, and don't get your off track, but I can find no other information on "CS_PARTITION_IDENT", which looks to me like a constant integer, not a fixed length string variable.
# define _CS_PARTITION_IDENT 10004 /* Partition Identifier */
This is in the unistd.h file, under a section titled:
/* Symbolic constants for confstr() defined by HP-UX: 10000-19999 */
Going a little further with this, a man on confstr() yields:
DESCRIPTION
confstr() provides a method for applications to get configuration-
defined string values. Its use and purpose are similar to sysconf()
(see sysconf(2)), except that it is used where string values rather
than numeric values are returned.
The function prototype to confstr is:
size_t confstr(int name, char *buf, size_t len);
The first argument "name" is actually an integer, and that's where you would pass the value "_CS_PARTITION_IDENT" which will be replaced with the value 10004 (by the precompiler). The next argument will return to YOU a pointer to buffer already malloc'd for you, and the last argument (len) will return you a length of how long the string is.
I hope I went the right direction with this information, and don't get your off track, but I can find no other information on "CS_PARTITION_IDENT", which looks to me like a constant integer, not a fixed length string variable.
We are the people our parents warned us about --Jimmy Buffett
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2003 08:36 AM
03-05-2003 08:36 AM
Re: CS_PARTITION_IDENT
Lionel,
the man page contains an example how to work with confstr()... it is recommended to first ask for the buffer size before actually retrieving the value. This is more flexible, instead of using 64 bytes fixed.
e.g.:
#include
#include
size_t bufsize;
char *buffer;
bufsize=confstr(_CS_PARTITION_IDENT,NULL,(size_t)0);
buffer=(char *)malloc(bufsize);
confstr(_CS_PARTITION_IDENT,buffer,bufsize);
BTW, _you_ need to allocate the buffer and tell confstr() how large the buffer is.
Best regards...
Dietmar.
the man page contains an example how to work with confstr()... it is recommended to first ask for the buffer size before actually retrieving the value. This is more flexible, instead of using 64 bytes fixed.
e.g.:
#include
#include
size_t bufsize;
char *buffer;
bufsize=confstr(_CS_PARTITION_IDENT,NULL,(size_t)0);
buffer=(char *)malloc(bufsize);
confstr(_CS_PARTITION_IDENT,buffer,bufsize);
BTW, _you_ need to allocate the buffer and tell confstr() how large the buffer is.
Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP