The UNIX and Linux Forums  

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
jus a minor issue. please assist if possible. jerryboy78 UNIX for Dummies Questions & Answers 1 03-17-2008 01:07 PM
hellaGUI: major bug fix and some minor ranting iBot Software Releases - RSS News 0 01-02-2008 11:10 PM
major & minor number RajaRC SUN Solaris 3 07-21-2004 07:04 PM
Increase Device Driver Major No in SunOs 5.8 haiudhaya High Level Programming 1 08-09-2002 01:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-21-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Device Major/Minor numbers

To further my fledgling knowledge of C, I am re-writing some of the Unix command set. My current command is an ls-style command.

All works well, except for device files. How do I get the major/minor numbers for the dev files?

I see from the stat struct there are st_rdev and st_dev members. Do these members relate to the major/minor numbers in any way?

I've read through man 2 stat and I can't suss the device file specifics out.

Any help would be greatly appreciated.

Cheers
ZB
Reply With Quote
Forum Sponsor
  #2  
Old 06-21-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Thumbs up

Many thanks Driver, that's exactly what I was looking for.

my_ls.c is now coming on very nicely!

Thanks again
ZB
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0