How to look up a system type?
- From: "Leo.Hou" <leo.hou@xxxxxxxxx>
- Date: 28 Aug 2006 20:05:45 -0700
(This thread was posted to lang.c by mistake. I think here is the right
I am new to linux and all the type definitions are driving me mad. What
is the best way to check a type definition in linux? When I use man
page to check some function definition, I may come across new types.
How do you guys look up their definitions?
I tried to lookup ssize_t, what I do is trace (grep in glibc source
to 'typedef __ssize_t ssize_t;',
then '__STD_TYPE __SSIZE_T_TYPE __ssize_t;'
then '#define __SSIZE_T_TYPE __SWORD_TYPE'
and finally '# define __SWORD_TYPE int'.
So 'int' it is, but that took me about 10 minutes... What is a better
way to do so? (any man page, web search, magic glibc function or bash
command that can give me the definition right away?)
Another question popped up when I was trying to do something like:
#define SIZE_OF_T(T) printf("size = %d\n", sizeof(T))
to make my life a bit easier. How can I use 'T' in the "size ="
formating string? I want to get something like
size of ssize_t = 4
as output. Can anyone help?
Thanks a lot x2 for two questions
- Prev by Date: Re: Is there a free asm2c converter?
- Next by Date: Re: How to look up a system type?
- Previous by thread: accessing the sound card from a module
- Next by thread: Re: How to look up a system type?