- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- What is the difference between CS_MACHINE_SERIAL a...
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
07-04-2017 08:15 AM - edited 07-04-2017 08:53 AM
07-04-2017 08:15 AM - edited 07-04-2017 08:53 AM
What is the difference between CS_MACHINE_SERIAL and MACHINE_SERIAL ?
What is the difference between CS_MACHINE_SERIAL and MACHINE_SERIAL ?
i get this question whenever i need to check the serial, what is the difference after all ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2017 04:44 AM
07-05-2017 04:44 AM
Re: What is the difference between CS_MACHINE_SERIAL and MACHINE_SERIAL ?
One is longer to type than the other?
According to getconf(1) man page, the getconf uses confstr(), pathconf() or sysconf() system calls/library routines to get the information it returns. Of these, only confstr() offers access to the serial number, because it's a string value. And the confstr(3C) man page indicates that the serial number could be queried programmatically like this:
#include <unistd.h> #define SERNUM_BUFFER_LEN 20 size_t result; char serial_num[SERNUM_BUFFER_LEN]; result = confstr(_CS_MACHINE_SERIAL, serial_num, SERNUM_BUFFER_LEN);
The /usr/include/unistd.h and /usr/include/sys/unistd.h only define the _CS_MACHINE_SERIAL constant: there is no corresponding constant without the CS_ prefix.
So, both "getconf CS_MACHINE_SERIAL" and "getconf MACHINE_SERIAL" might both be aliases to the same code.
I just ran "tusc -o no_cs.log getconf MACHINE_SERIAL" and "tusc -o with_cs.log getconf CS_MACHINE_SERIAL" and can confirm this: there is no difference between "getconf MACHINE_SERIAL" and "getconf CS_MACHINE_SERIAL" at the system call level. The only difference in tusc outputs was on the first line, which includes the command line parameters given to getconf (which are obviously different).
So CS_;MACHINE_SERIAL is probably offered by getconf to match the programmatic interface, and MACHINE_SERIAL as an alias to it because it's easier to type.
(This is what happens when I'm bored at work in a summer vacation season...)