[Gllug] Off Topic: C File Descriptors

Daniel P. Berrange dan at berrange.com
Mon Mar 10 00:26:02 UTC 2008


On Sun, Mar 09, 2008 at 11:55:45PM +0000, Tethys wrote:
> --------
> 
> salsaman at xs4all.nl writes:
> 
> >> /include/linux/limits.h defines the max path length as 4096
> >
> >Hmmm...it must have increased since I last looked...:-/
> 
> ...which is exactly why you should be use PATH_MAX rather than
> a hardcoded number!

NB, POSIX does *not*  require PATH_MAX to be defined. If the OS supports
an "unlimited" filename length, then PATH_MAX won't be defined at all.
If practical best to avoid static limits altogether and only use PATH_MAX
if you explicitly want/need to enforce a limit for some reason.

Dan.
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080310/7894e9dd/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list