The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Urgent : Help required V3l0 AIX 2 01-11-2008 11:37 AM
ftp from unix to windows - urgent help required sam_sal_manu Shell Programming and Scripting 1 09-04-2007 05:28 PM
Urgent help required umanglalani Shell Programming and Scripting 1 04-12-2007 03:24 AM
Urgent Help required rahul26 UNIX for Dummies Questions & Answers 1 08-16-2006 01:23 PM
C programming - Urgent help required kkumar1975 High Level Programming 2 04-08-2002 07:36 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-23-2005
rm1 rm1 is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 2
Urgent help required with uname()

Hello,

I am doing a program in C on UNIX Platform. I am required to make it display the Machine Name, OS name and OS Release version using uname.

Now I went through the man pages and found out that uname can be implemented using -

#include <sys/utsname.h>

int uname (name)
struct utsname *name;

So after doing this step every time I do printf ("%s", name) ;

It displays the operating system name.

So I was trying to move forward and I tried printf ("%s", ++name) ;
And it gave me some long path name.

The third time I tried for release version - printf ("%s", ++name) ;

I got this segmentation error.

No matter how I try the printf I do not get release version and end up stalling on segmentation error.

Can someone help me out on this matter? I just need the correct format for running the various options of uname from the structure utsname.

Thanking You in Advance,

RM1
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0