Bug 222598 - build fails on Solaris - NAME_MAX missing
Summary: build fails on Solaris - NAME_MAX missing
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-13 22:26 UTC by tropikhajma
Modified: 2010-02-02 18:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch (483 bytes, patch)
2010-01-13 22:48 UTC, tropikhajma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tropikhajma 2010-01-13 22:26:52 UTC
Version:           4.3.90 (using Devel)
Compiler:          Sun Studio 12 U1 
OS:                Solaris
Installed from:    Compiled sources

building kdenetwork 4.3.90 on OpenSolaris with Sun Studio fails with
...
"/home/test/packages/BUILD/kdenetwork-4.3.90/kget/transfer-plugins/bittorrent/libbtcore/util/fileops.cpp", line 474: Error: NAME_MAX is not defined.
"/home/test/packages/BUILD/kdenetwork-4.3.90/kget/transfer-plugins/bittorrent/libbtcore/util/fileops.cpp", line 497: Error: NAME_MAX is not defined.
"/home/test/packages/BUILD/kdenetwork-4.3.90/kget/transfer-plugins/bittorrent/libbtcore/util/fileops.cpp", line 503: Error: NAME_MAX is not defined.
"/home/test/packages/BUILD/kdenetwork-4.3.90/kget/transfer-plugins/bittorrent/libbtcore/util/fileops.cpp", line 562: Error: NAME_MAX is not defined.
4 Error(s) detected.

after some investigation I came to this comment in the /usr/include/limits.h header file.

/*
 * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
 * related text states:
 *
 * A definition of one of the values from Table 2-5 shall be omitted from the
 * <limits.h> on specific implementations where the corresponding value is
 * equal to or greater than the stated minimum, but where the value can vary
 * depending on the file to which it is applied. The actual value supported for
 * a specific pathname shall be provided by the pathconf() (5.7.1) function.
 *
 * This is clear that any machine supporting multiple file system types
 * and/or a network can not include this define, regardless of protection
 * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
 *
 * #define      NAME_MAX        14
 */

I'm not sure if switching to pathconf() is feasible. We're using the attached patch which is merely a hack (its second part is dealing with other bug)
Comment 1 Matthias Fuchs 2010-01-13 22:37:43 UTC
Please try if KTorrent compiles from you, it should have the same problem as that code is part of KTorrent.
Comment 2 Lukas Appelhans 2010-01-13 22:47:54 UTC
Yup indeed, this is definitely a KTorrent issue... apart from that, there's no patch attached :/

Lukas
Comment 3 tropikhajma 2010-01-13 22:48:41 UTC
Created attachment 39857 [details]
patch
Comment 4 Joris Guisson 2010-02-02 18:36:49 UTC
SVN commit 1084197 by guisson:

Fix compilation not working on solaris due to missing NAME_MAX define

BUG: 222598

 M  +1 -0      ChangeLog  
 M  +2 -4      libbtcore/diskio/singlefilecache.cpp  
 M  +4 -0      libbtcore/util/fileops.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1084197