struct utsname throwing error : Value too large to be stored in data type


 
Thread Tools Search this Thread
Operating Systems HP-UX struct utsname throwing error : Value too large to be stored in data type
# 1  
Old 06-15-2011
struct utsname throwing error : Value too large to be stored in data type

Hi,
I am trying to fetch sysname and nodename using struct utsname. I have two HP-UX servers on with 10 characters and other with 13 characters host name. For the first one I am getting truncated 8 characters as output but for the second one i am getting "Value too large to be stored in data type" error. Why this is so ?
What should I do to avoid getting this error ?

Here is the sample code which I am using :
Code:
#include<stdio.h>
#include<sys/utsname.h>

int main()
{
struct utsname uts;

if(uname(&uts) != -1)
{
printf("\n sysname :%s",uts.sysname);
printf("\n nodename :%s",uts.nodename);
}
else
{
printf( "Error fetching uname: %s\n", strerror( errno ) );
perror( "Error fetching uname :" );
}
return 0;
}


Last edited by pludi; 06-15-2011 at 04:32 AM..
# 2  
Old 06-15-2011
It's not supposed to do that: uname(2)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

AIX and Value too large to be stored in data type.

root@test8:/config1>oslevel -s 5300-01-00-0000 root@test8:/config1>oslevel -r 5300-01 while moving a file sized 9GB i got this message root@test8:/configapp>mv bkp_14JUN16_oraapp_2.tgz /oraapp bkp_14JUN16_oraapp_2.tgz: Value too large to be stored in data type. possibly need APAR... (2 Replies)
Discussion started by: filosophizer
2 Replies

2. Programming

Correct way to read data of different formats into same struct

I was wondering what is the correct way to read in data "one-part-per-line" as compared with "one-record-per-line" formats into the same structure in C? format1.dat: Zacker 244.00 244.00 542.00 Lee 265.00 265.00 456.00 Walter 235.00 235.00 212.00 Zena 323.00 215.45 ... (12 Replies)
Discussion started by: yifangt
12 Replies

3. Programming

Struct as return type

Hello all, I am trying to define a function with return type as struct, but seem to be failing. Error I am receiving is following .CC error: prototype for 'RpcHOData L1ITMu::MBLTCollection::getUnassociatedHORpcClusters(double)' does not match any in class 'L1ITMu::MBLTCollection' struct... (1 Reply)
Discussion started by: emily
1 Replies

4. Shell Programming and Scripting

Function throwing an error

Hi All I have two shell scripts where the second is getting invoked from the first. E.g. test1.sh and test2.sh Within test1, the code is something like this: #!/bin/bash . test2.sh usage() { echo "..." echo "....." } SRC=$1 DEST=$2 case "$3" in tran) doTran ;; *)... (7 Replies)
Discussion started by: swasid
7 Replies

5. Programming

Storing C++-struct in file - problem when adding new item in struct

Hi, I have received an application that stores some properties in a file. The existing struct looks like this: struct TData { UINT uSizeIncludingStrings; // copy of Telnet data struct UINT uSize; // basic properties: TCHAR szHost; //defined in Sshconfig UINT iPortNr; TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies

6. Programming

writing binary/struct data to file

I am trying to write binary data to a file. My program below: #include <stdlib.h> #include <stdio.h> struct tinner { int j; int k; }; struct touter { int i; struct tinner *inner; }; int main() { struct touter data; data.i = 10; struct tinner... (4 Replies)
Discussion started by: radiatejava
4 Replies

7. SCO

Error: Value too large for defined data type

Hi all, I have this problem in one of the SCO UNIXWare 7.1.4. We have an application which is working on hundreds of machines. When we try to install the same application on a new machine, the executable/binary gives the following error and exits... "xxx startup failure: Value too large for... (1 Reply)
Discussion started by: chava01
1 Replies

8. AIX

Value too large to be stored in data type???

Hello, I get this message : "Value too large to be stored in data type" when I try to open a 3Gb file. Can someone helps me to resolve the problem. Thank you very much (5 Replies)
Discussion started by: limame
5 Replies

9. UNIX for Dummies Questions & Answers

gzip:Value too large for defined data type

SunOS machinename 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-Enterprise-10000 I am gzipping a file over 2GB and get this error message: Filename :Value too large for defined data type Is this because the file is over 2GB? (1 Reply)
Discussion started by: dangral
1 Replies
Login or Register to Ask a Question