| Linux - Kernel This forum is for all discussion relating to the Linux kernel. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-19-2009, 01:17 PM
|
#1
|
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Rep:
|
truct keyword...
hi there...
as i was wandering in the world of linux kernel headers, i stumbled on a type-name-like-thing with the name truct.
one example follows...
Code:
truct modversion_info
unsigned long crc;
char name[MODULE_NAME_LEN];
;
does anyone know anything more or should i just grep it until i find its definition!?
thx ppl!
dave.
|
|
|
|
05-20-2009, 06:58 AM
|
#2
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Unless someone declared an alias (or whatever C calls it), it's a typo. Should be "struct".
|
|
|
|
05-20-2009, 07:01 AM
|
#3
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,234
|
Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:
struct modversion_info
{
unsigned long crc;
char name[MODULE_NAME_LEN];
};
|
|
|
|
05-20-2009, 02:22 PM
|
#4
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
Originally Posted by syg00
Something is trimming column 1 off your data (or your display). I'd lay a small wager it should look like
Code:
struct modversion_info
{
unsigned long crc;
char name[MODULE_NAME_LEN];
};
|
bingo!! That's the answer.
|
|
|
|
05-21-2009, 08:17 AM
|
#5
|
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Original Poster
Rep:
|
well, it kinda crossed my mind, but, on the same file all edge charachters are present!
#includes <...> are not deprived of a #, and as you can see, the semicolons line up properly!
|
|
|
|
05-21-2009, 08:26 AM
|
#6
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Does it matter what program you use to read the file?
What happens if you do this?:
grep -A4 "truct modversion" filename
|
|
|
|
05-21-2009, 08:31 AM
|
#7
|
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Original Poster
Rep:
|
just try the next command...
Code:
/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!
|
|
|
|
05-21-2009, 08:38 AM
|
#8
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,234
|
Instead of -o, try word bounding ... 
|
|
|
|
05-21-2009, 08:53 AM
|
#9
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Quote:
Originally Posted by antiregulator
just try the next command...
Code:
/usr/src/linux/include/linux/grep -o truct ./*|sort|most
and see how widesperad is the use of truct!
|
how is that syntax supposed to work?? Here, it tries to run "grep" in that path and of course cannot find it.
But, why are you asking us to run commands? You need to figure what's happening on your machine......
|
|
|
|
05-21-2009, 09:18 AM
|
#10
|
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Original Poster
Rep:
|
i did not force anyone to run any command at anytime m8!
and what is happening to my computer, possibly happens to yours as well!
and i am trully sorry for making a mistake in my command syntax. what i meant was
Code:
/usr/src/linux/include/linux/# grep -o truct ./*|sort|most
|
|
|
|
05-22-2009, 08:20 AM
|
#11
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
bingo!! that does make more sense.....
"grep -o" returns only the search string, so what you are seeing is quite normal. It will find every line containing "truct" and print out only the "truct". It will do this for every line containing "struct".
syg00 has the right answer (word bounding)
I also asked if you had the same issue when using different programs to read the files.......
|
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:21 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|