Forum: Ruby-core [Closed] r45598 causes Errno::EINVAL on Solaris

F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2014-04-18 01:51
(Received via mailing list)
Issue #9752 has been updated by Nobuyoshi Nakada.

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

Applied in changeset r45615.

---------- rb_cv_getcwd_malloc

* (rb_cv_getcwd_malloc): check if getcwd allocates
  buffer if NULL is given [ruby-core:62072] [Bug #9752]

Bug #9752: r45598 causes Errno::EINVAL on Solaris

* Author: Naohisa Goto
* Status: Closed
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-04-17) [sparc64-solaris2.10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
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.
This topic is locked and can not be replied to.