- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Erros when using -D_HPUX_API_LEVEL=20040821
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-28-2009 02:50 AM
тАО01-28-2009 02:50 AM
bash-3.2# aCC -D_HPUX_API_LEVEL=20040821 long_hostname.c
Error 19: "/usr/include/sys/utsname.h", line 73 # Unexpected 'utsname'.
struct __UTSNAME_VERSION_V2_ATTR utsname {
^^^^^^^
Error 373: "/usr/include/sys/utsname.h", line 73 # Old-style function definition parameter must be a simple identifier.
struct __UTSNAME_VERSION_V2_ATTR utsname {
^^^^^^^^^^^^^^^^^^^^^^^^^
Error 43: "/usr/include/sys/utsname.h", line 73 # C++ does not allow Old-style (non-prototype) function definitions.
struct __UTSNAME_VERSION_V2_ATTR utsname {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error 305: "/usr/include/sys/utsname.h", line 73 # Function definitions must return completed object type or void.
struct __UTSNAME_VERSION_V2_ATTR utsname {
^^^^^^^^^^^^^^^^^^^^^^^^^
Warning 361: "/usr/include/sys/utsname.h", line 73 # Value-returning function might end without executing a return statement.
struct __UTSNAME_VERSION_V2_ATTR utsname {
^^^^^^^^^^^^^^^^^^^^^^^^^
Error 20: "/usr/include/sys/utsname.h", line 91 # '{' expected before '__attribute__'.
extern int uname(struct utsname *) __UNAME_VERSION_ATTR;
^^^^^^^^^^^^^^^^^^^^
Error 284: "/usr/include/sys/utsname.h", line 91 # Called function must return completed object type or void.
extern int uname(struct utsname *) __UNAME_VERSION_ATTR;
^^^^^^^^^^^^^^^^^^^^
Warning 361: "/usr/include/sys/utsname.h", line 91 # Value-returning function might end without executing a return statement.
extern int uname(struct utsname *) __UNAME_VERSION_ATTR;
^^^^^
Error 628: "long_hostname.c", line 8 # "utsname n" ["long_hostname.c", line 8] cannot be defined to have an incomplete type.
struct utsname n;
^
Error 548: "long_hostname.c", line 14 # The expression on the left side of the '.' (dot member access operator) must be a completed class object type; the
type of the left side is 'tentative struct utsname' and 'struct utsname' has not been defined yet.
intf("sysname=%s, release=%s, version=%s\n",n.sysname,n.release,n.version);
^
Error 20: "long_hostname.c", line 2716 # '}' expected before '
bash-3.2#
Here is a sample .
bash-3.2# cat long_hostname.c
#include
#include
#define SYS_NMLN1 257
#define SNLEN1 257
int main()
{
struct utsname n;
int ret;
ret = uname(&n);
printf("ret = %d" , ret);
if(ret >=0 )
{
printf("sysname=%s, release=%s, version=%s\n",n.sysname,n.release,n.version);
}
else
{
perror("Uname");
}
return 0;
}
Has somebdy seen these errors before?
Solved! Go to Solution.
- Tags:
- long hostname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 05:21 AM
тАО01-28-2009 05:21 AM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
What version of aC++ do you have? It is highly likely that version doesn't support this functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 10:39 AM
тАО01-28-2009 10:39 AM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 10:46 AM
тАО01-28-2009 10:46 AM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
I think I have only these options left if -D_HPUX_API_LEVEL=20040821 does not work:
-ignore EOVERFLOW as I am not interested in utsname.nodename. But this behavior can change
in any new HPUX release. EOVERFLOW and population of utname can be made mutually exclusive.
- Set tunable uname_eoverflow=0 as we do not care about the nodename field.
-use something else instead of uname(2M). e.g popen("uname -r") etc. to get the data
Do you know of any more methods?
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 04:26 PM
тАО01-28-2009 04:26 PM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
Why? You are using A.03.37 but the first compiler that was supported for 11.23 is A.03.55.
You need at least A.03.39.
>Do you know of any more methods?
Call uname(2) in a C source, using a newer C compiler.
- Tags:
- uname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2009 07:37 AM
тАО01-29-2009 07:37 AM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
:-(. I have fixed the app to not to use uname.
But on IA i am facing a strange issue, the application does not even start and it dumps with "unknown error" as soon as its started. even main() not getting called.
when I set the hostname to less then 8 chars or set uname_eoverflow to 0 it starts without problems. Is this is known issue with aries/linker on systems with long hostnames?
Thanks
Sri
- Tags:
- Aries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2009 03:11 PM
- Tags:
- dld
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2009 09:28 PM
тАО01-29-2009 09:28 PM
Re: Erros when using -D_HPUX_API_LEVEL=20040821
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2009 09:29 PM
тАО01-29-2009 09:29 PM