LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-26-2006, 03:03 PM   #1
htarko
LQ Newbie
 
Registered: Aug 2006
Posts: 5

Rep: Reputation: 0
linux bits directory


Could someone tell me why linux has many header files in the /usr/include direcory with an identically named file in the /usr/include/bits directory. For example, if one wants to see a definition of the termios struct it isn't in /usr/include/termios.h, but in /usr/include/bits/termios.h. Of course, there is an #include <bits/termios.h> statement in termios.h, but why are there two files?

htarko
 
Old 08-27-2006, 07:48 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Moved: This thread is more suitable in the Programming Forum and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-28-2006, 11:23 AM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
All standard C++ headers are supposed to be .h-less. The names of the headers and behaviors of the classes are specified in the C++ standard, however the implementation is left up to the lib author. Most of the headers are for templates and therefore include some source code, and many of the includes include multiple bits headers (such as constants and settings that have separate files.) Basically, the main directory is for the standard-compliant file names, and the bits subdirectory allows the developers to manage the code in whatever manner they choose.
ta0kira
 
Old 08-29-2006, 08:59 AM   #4
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
The bits sub-directory is there to support diffent "endianness", for one thing.
In other words, it is system-specific. If you go to a big endian system or a little endian system the same filenames will be there. What's in them will be different.

The /usr/include/sys subdirectory does the same thing. You'll notice that stat.h is in sys because how it works is usually system-specific.
 
Old 08-30-2006, 07:16 AM   #5
htarko
LQ Newbie
 
Registered: Aug 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you. Tha makes sense
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox 64 bits and 32 bits Marcolux Linux - Software 0 05-23-2006 12:21 PM
32 bits version distros running 64 bits CPU javb Linux - General 4 04-02-2006 07:21 AM
Java 64 bits and applications of 32 bits RGB_mdk Linux - Software 3 06-13-2005 09:05 AM
Problem moving directory - invisible bits? slakmagik Linux - Software 9 12-01-2003 05:11 PM
Linux: I need a 64 bits integer chenjifu Programming 1 06-12-2001 09:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration