public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc
@ 2005-05-30 14:40 ams at gnu dot org
  2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelImpl.cc pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ams at gnu dot org @ 2005-05-30 14:40 UTC (permalink / raw)
  To: java-prs

Please do not use MAXPATHLEN, it is a arbitrary limit, and is not
defined on GNU.  Currently this makes libjava (gcc 4.0.0) unbuildable on GNU
since [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc assumes that
MAXPATHLEN is defined.  Please do not use these kind of limits in GNU programs.

Not having MAXPATHLEN is perfectly compliant with POSIX, same goes for
MAXHOSTNAMELEN, PATH_MAX etc.

-- 
           Summary: MAXPATHLEN usage in
                    [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.c
                    c
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ams at gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
 GCC build triplet: i686-pc-gnu0.3
  GCC host triplet: i686-pc-gnu0.3
GCC target triplet: i686-pc-gnu0.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelPosix.cc
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
  2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelImpl.cc pinskia at gcc dot gnu dot org
@ 2005-05-30 14:42 ` pinskia at gcc dot gnu dot org
  2005-05-30 14:53 ` [Bug libgcj/21821] MAXPATHLEN usage in libjava ams at gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-30 14:42 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|MAXPATHLEN usage in         |MAXPATHLEN usage in
                   |natFileChannelImpl.cc       |natFileChannelPosix.cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelImpl.cc
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
@ 2005-05-30 14:42 ` pinskia at gcc dot gnu dot org
  2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelPosix.cc pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-30 14:42 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|java                        |libgcj
           Keywords|                            |build
            Summary|MAXPATHLEN usage in         |MAXPATHLEN usage in
                   |[gcc]/libjava/gnu/java/nio/c|natFileChannelImpl.cc
                   |hannels/natFileChannelImpl.c|
                   |c                           |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
  2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelImpl.cc pinskia at gcc dot gnu dot org
  2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelPosix.cc pinskia at gcc dot gnu dot org
@ 2005-05-30 14:53 ` ams at gnu dot org
  2005-05-30 15:01 ` schwinge-bugzilla-gcc dot gnu dot org at nic-nac-project dot de
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ams at gnu dot org @ 2005-05-30 14:53 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From ams at gnu dot org  2005-05-30 14:53 -------
[gcc]/libjava/java/io/natFilePosix.cc is also broken due to the usage of MAXPATHLEN.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|MAXPATHLEN usage in         |MAXPATHLEN usage in libjava
                   |natFileChannelPosix.cc      |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
                   ` (2 preceding siblings ...)
  2005-05-30 14:53 ` [Bug libgcj/21821] MAXPATHLEN usage in libjava ams at gnu dot org
@ 2005-05-30 15:01 ` schwinge-bugzilla-gcc dot gnu dot org at nic-nac-project dot de
  2005-05-30 15:14 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: schwinge-bugzilla-gcc dot gnu dot org at nic-nac-project dot de @ 2005-05-30 15:01 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schwinge-bugzilla-gcc dot
                   |                            |gnu dot org at nic-nac-
                   |                            |project dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
                   ` (3 preceding siblings ...)
  2005-05-30 15:01 ` schwinge-bugzilla-gcc dot gnu dot org at nic-nac-project dot de
@ 2005-05-30 15:14 ` pinskia at gcc dot gnu dot org
  2005-05-30 15:51 ` mckinlay at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-30 15:14 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |21824
              nThis|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
                   ` (4 preceding siblings ...)
  2005-05-30 15:14 ` pinskia at gcc dot gnu dot org
@ 2005-05-30 15:51 ` mckinlay at redhat dot com
  2005-05-30 16:19 ` cvs-commit at gcc dot gnu dot org
  2005-05-30 16:23 ` ams at gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mckinlay at redhat dot com @ 2005-05-30 15:51 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2005-05-30 15:35 -------
Its easy to fix this for natFileChannelImpl.cc.

For natFilePosix.cc it is not so simple - is there a portable alternative to
realpath() that does not require the use of MAXPATHLEN / PATH_MAX ?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-30 15:35:43
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
                   ` (5 preceding siblings ...)
  2005-05-30 15:51 ` mckinlay at redhat dot com
@ 2005-05-30 16:19 ` cvs-commit at gcc dot gnu dot org
  2005-05-30 16:23 ` ams at gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-30 16:19 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-30 16:14 -------
Subject: Bug 21821

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bryce@gcc.gnu.org	2005-05-30 16:02:40

Modified files:
	libjava        : ChangeLog 
	libjava/gnu/java/nio/channels: natFileChannelPosix.cc 

Log message:
	2005-05-30  Bryce McKinlay  <mckinlay@redhat.com>
	
	PR libgcj/21821
	* gnu/java/nio/channels/natFileChannelPosix.cc (open): Don't use
	MAXPATHLEN. Format exception message using a StringBuffer instead.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3639&r2=1.3640
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/nio/channels/natFileChannelPosix.cc.diff?cvsroot=gcc&r1=1.6&r2=1.7



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/21821] MAXPATHLEN usage in libjava
  2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
                   ` (6 preceding siblings ...)
  2005-05-30 16:19 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-30 16:23 ` ams at gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: ams at gnu dot org @ 2005-05-30 16:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From ams at gnu dot org  2005-05-30 16:23 -------
(In reply to comment #2)
> Its easy to fix this for natFileChannelImpl.cc.

Thank you for fixing it!

> For natFilePosix.cc it is not so simple - is there a portable alternative to
> realpath() that does not require the use of MAXPATHLEN / PATH_MAX ?

One can call realpath() with NULL for the second parameter on systems that do
not have MAXPATHLEN/PATH_MAX.  You could also use canonicalize_file_name(), but
this is a GNU C library specific function.

 -- Function: char * realpath (const char *restrict NAME, char
          *restrict RESOLVED)
...
     On systems which define `PATH_MAX'
     this means the buffer must be large enough for a pathname of this
     size.  For systems without limitations on the pathname length the
     requirement cannot be met and programs should not call `realpath'
     with anything but `NULL' for the second parameter.

 -- Function: char * canonicalize_file_name (const char *NAME)
     The `canonicalize_file_name' function returns the absolute name of
     the file named by NAME which contains no `.', `..' components nor
     any repeated path separators (`/') or symlinks.  The result is
     passed back as the return value of the function in a block of
     memory allocated with `malloc'.  If the result is not used anymore
     the memory should be freed with a call to `free'.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21821


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-05-30 16:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-30 14:40 [Bug java/21821] New: MAXPATHLEN usage in [gcc]/libjava/gnu/java/nio/channels/natFileChannelImpl.cc ams at gnu dot org
2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelImpl.cc pinskia at gcc dot gnu dot org
2005-05-30 14:42 ` [Bug libgcj/21821] MAXPATHLEN usage in natFileChannelPosix.cc pinskia at gcc dot gnu dot org
2005-05-30 14:53 ` [Bug libgcj/21821] MAXPATHLEN usage in libjava ams at gnu dot org
2005-05-30 15:01 ` schwinge-bugzilla-gcc dot gnu dot org at nic-nac-project dot de
2005-05-30 15:14 ` pinskia at gcc dot gnu dot org
2005-05-30 15:51 ` mckinlay at redhat dot com
2005-05-30 16:19 ` cvs-commit at gcc dot gnu dot org
2005-05-30 16:23 ` ams at gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).