size_t and ssize_t

size_t and ssize_t

Post by uujajeo » Sat, 19 Aug 2000 04:00:00



hello...
i found that the sizeof size_t and ssize_t is 4 ....in my linux box..
why use size_t and ssize_t instead of int?
is there special meaning...?
 
 
 

size_t and ssize_t

Post by Martin Kahle » Sat, 19 Aug 2000 04:00:00




Quote:> hello...
> i found that the sizeof size_t and ssize_t is 4 ....in my linux box..

                                                      ^^^^^^^^^^^^^^
that's the point. There are a lot of systems, where this is
different (e.g. on our SGI sizeof size_t = 8 and
sizeof int = 4), thus you will introduce a big debugging
hassle into your code for everyone who has to/wants to port your prog.

Quote:> why use size_t and ssize_t instead of int?
> is there special meaning...?

Bye,
Martin.

--
The early bird gets the worm. If you want something else for      
breakfast, get up later.

 
 
 

1. int, pid_t, size_t and ssize_t

Hello there:
  This question has been arisen in my mind for quite a logn time but I
did not go deep into it until today.

  I did not differentiate types of 'int', 'pid_t' and 'size_t' and
regarded them as int.  However,  I read 'man 2 read' and 'man 2 write'
today and there came another type definition 'ssize_t.'  I could
understand why we need 'pid_t', 'size_t' but why we need 'ssize_t'?  Can
anyone give me a hint?

Thanks

TCS

2. Dos partition

3. ssize_t, size_t *n -- naming conventions?

4. CAN AWK KEEP COUNT

5. Matrox Mystique ands X.

6. Linux Doc Project - How to?

7. Is ssize_t a standard POSIX type?

8. Blasted street transformer exploded!

9. kernel and size_t

10. size_t ... where the heck is it?

11. Size of size_t?

12. coding style advice for sizeof (long) < sizeof (size_t)?

13. OpenBSD file system (size_t vs. off_t)