Bug #9752

r45598 causes Errno::EINVAL on Solaris

Added by Naohisa Goto 12 months ago. Updated 9 months ago.

[ruby-core:62072]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:ruby 2.2.0dev (2014-04-17) [sparc64-solaris2.10] Backport:2.0.0: DONTNEED, 2.1: DONTNEED

Description

On Solaris, after r45598, the following error occurs.

./miniruby: Invalid argument - getcwd (Errno::EINVAL)

It seems that getcwd(NULL, 0) is not supported in Solaris.
The Solaris man page of getcwd(3c) says:

If buf is a null pointer, getcwd() obtains size bytes of
space using malloc(3C). The pointer returned by getcwd() can
be used as the argument in a subsequent call to free().

But no description when the size is zero.

Associated revisions

Revision 45615
Added by Nobuyoshi Nakada 12 months ago

configure.in: rb_cv_getcwd_malloc

  • configure.in (rb_cv_getcwd_malloc): check if getcwd allocates buffer if NULL is given [Bug #9752]

Revision 45615
Added by Nobuyoshi Nakada 12 months ago

configure.in: rb_cv_getcwd_malloc

  • configure.in (rb_cv_getcwd_malloc): check if getcwd allocates buffer if NULL is given [Bug #9752]

History

#1 Updated by Daniel Berger 12 months ago

Is this a Solaris issue specifically? Or is this broken on other commercial platforms as well, like AIX and HP-UX?

#2 Updated by Nobuyoshi Nakada 12 months ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45615.


configure.in: rb_cv_getcwd_malloc

  • configure.in (rb_cv_getcwd_malloc): check if getcwd allocates buffer if NULL is given [Bug #9752]

#3 Updated by Usaku NAKAMURA 9 months ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED

Also available in: Atom PDF