- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HPUX 11.31 uname issue
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
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
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
тАО01-24-2011 03:07 AM
тАО01-24-2011 03:07 AM
HPUX 11.31 uname issue
it just shows pc123456 only so my application which uses uname function it also fail?
any workaround on this .
Waiting for reply.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:11 AM
тАО01-24-2011 03:11 AM
Re: HPUX 11.31 uname issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:19 AM
тАО01-24-2011 03:19 AM
Re: HPUX 11.31 uname issue
can you please give me the doc id of HP UX
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:26 AM
тАО01-24-2011 03:26 AM
Re: HPUX 11.31 uname issue
From the MAN pages of uname(1):
Change the node name (system name) to nodename.
nodename is restricted to UTSLEN-1 characters (see uname(2)). See WARNINGS. Only users with appropriate privileges can use the -S option.
from the MAN pages of uname(2):
The utsname structure, defined in
follows:
#define UTSLEN 9
#define SNLEN 15
char sysname[UTSLEN];
char nodename[UTSLEN];
_______________________________________
> setuname()
The setuname() system call sets the node name (system name), as returned in the nodename field of the utsname structure, to name, which has a length of namelen characters. This is usually executed by /sbin/init.d/hostname at system boot time. Names are limited to UTSLEN - 1 characters; UTSLEN is defined in
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:30 AM - last edited on тАО11-10-2011 07:52 AM by Kevin_Paul
тАО01-24-2011 03:30 AM - last edited on тАО11-10-2011 07:52 AM by Kevin_Paul
Re: HPUX 11.31 uname issue
See this thread for an extended, and detailed discussion of nodename/hostname/uname and the associated rules:
http://h30499.www3.hp.com/t5/System-Administration/hostname-and-nodename/m-p/3788510#M264534
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:30 AM
тАО01-24-2011 03:30 AM
Re: HPUX 11.31 uname issue
in HPUX v3
# define UTSLEN _SYS_NMLN
And UMLN value
#define __SYS_NMLN_V1 9
the nodename length = UTSLEN-1 = 8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:40 AM
тАО01-24-2011 03:40 AM
Re: HPUX 11.31 uname issue
Yes, you'll get EOVERFLOW if longer than 8. Unless you compile it with the special options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 03:48 AM
тАО01-24-2011 03:48 AM
Re: HPUX 11.31 uname issue
my utsname.h file is like this .....
/*
* BEGIN_DESC
*
* Copyright (c) 1996-2004 Hewlett-Packard Development Company, LP
*
* File:
* @(#)B.11.31_LR common/sys/utsname.h $Revision: $
*
* Purpose:
* Definitions for uname(2) and setuname(2)
*
* Classification: Release to Release Consistency Req:
* public binary & source
*
* BE header: yes
*
* Shipped: yes
* /usr/include/sys/utsname.h
* /usr/conf/sys/utsname.h
*
* END_DESC
*/
#ifndef _SYS_UTSNAME_INCLUDED
#define _SYS_UTSNAME_INCLUDED
#include
#define __SYS_NMLN_V2 257
#define __SYS_NMLN_V1 9
#define __SNLEN_V2 257
#define __SNLEN_V1 15
#define __UTSNAME_VERSION_V2_ATTR _HPUX_API_VERS_20040821_ATTR
#define _UTSNAME_COMMON_FIELDS(_nmln, _snlen) \
char sysname[_nmln]; \
char nodename[_nmln]; \
char release[_nmln]; \
char version[_nmln]; \
char machine[_nmln]; \
char __idnumber[_snlen];
#define _UTSNAME_EXTENDED_FIELDS(_nmln) \
char __domainname[_nmln]; \
char __reserved1[_nmln];
#ifdef _INCLUDE_HPUX_SOURCE
struct utsname_hpux_v1 {
_UTSNAME_COMMON_FIELDS(__SYS_NMLN_V1, __SNLEN_V1)
};
#endif /* _INCLUDE_HPUX_SOURCE */
#if (_INCLUDE_HPUX_API_LEVEL < 20040821)
#define _SYS_NMLN __SYS_NMLN_V1
#define _SNLEN __SNLEN_V1
#define __UNAME_VERSION_ATTR
struct utsname {
_UTSNAME_COMMON_FIELDS(__SYS_NMLN_V1, __SNLEN_V1)
};
#else /* _INCLUDE_HPUX_API_LEVEL >= 20040821 */
#define _SYS_NMLN __SYS_NMLN_V2
#define _SNLEN __SNLEN_V2
#define __UNAME_VERSION_ATTR __UTSNAME_VERSION_V2_ATTR
struct __UTSNAME_VERSION_V2_ATTR utsname {
_UTSNAME_COMMON_FIELDS(__SYS_NMLN_V2, __SNLEN_V2)
_UTSNAME_EXTENDED_FIELDS(__SYS_NMLN_V2)
};
#endif /* _INCLUDE_HPUX_API_LEVEL >= 20040821 */
#ifdef _INCLUDE_HPUX_SOURCE
# define SYS_NMLN _SYS_NMLN
# define UTSLEN _SYS_NMLN
# define SNLEN _SNLEN
# define idnumber __idnumber
# define domainname __domainname
#endif /* _INCLUDE_HPUX_SOURCE */
#ifndef _NO_USER_PROTOS
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
By default _INCLUDE_HPUX_SOURCE is only defined and if we have to change it then how to change it? i am seeing the __SYS_NMLN_V2 257 also so how to use this one..
my uname -a
uname -a
HP-UX pumass00 B.11.31 U ia64 1883224899 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 04:10 AM
тАО01-24-2011 04:10 AM
Re: HPUX 11.31 uname issue
You should not be looking at utsname.h to figure out how to program. You should be looking at the thread and documentation that Pete mentioned. Are you prepared to recompile every application that calls uname(2)?
See expanded_node_host_names(5):
http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02254938/c02254938.pdf
>HP-UX pumass00 B.11.31 U ia64 1883224899
If your nodename is > 8, uname(1) doesn't check for errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 04:25 AM
тАО01-24-2011 04:25 AM