Project

General

Profile

Bug #14864

some old linux has no O_CLOEXEC

Added by wangpeiwen (沛文 王) over 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:87591]

Description

I get some error when building ruby on suse 10,

compiling dir.c
dir.c: In function ‘nogvl_opendir_at’:
dir.c:1439: error: ‘O_CLOEXEC’ undeclared (first use in this function)
dir.c:1439: error: (Each undeclared identifier is reported only once
dir.c:1439: error: for each function it appears in.)
make: *** [Makefile:398: dir.o] Error 1

and I see some "ifdef O_CLOEXEC" in io.c and etc.

ext/dbm/dbm.c:169:29:     * gdbm 1.10 works with O_CLOEXEC.  gdbm 1.9.1 silently ignore it.
ext/dbm/dbm.c:171:9:#ifndef O_CLOEXEC
ext/dbm/dbm.c:172:12:#   define O_CLOEXEC 0
ext/dbm/dbm.c:177:49:        dbm = dbm_open(RSTRING_PTR(file), flags|O_CLOEXEC, mode);
ext/dbm/dbm.c:182:62:            dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CREAT|O_CLOEXEC, mode);
ext/dbm/dbm.c:185:54:            dbm = dbm_open(RSTRING_PTR(file), O_RDWR|O_CLOEXEC, 0);
ext/dbm/dbm.c:188:56:            dbm = dbm_open(RSTRING_PTR(file), O_RDONLY|O_CLOEXEC, 0);
ext/sdbm/_sdbm.c:228:8:#ifdef O_CLOEXEC
ext/sdbm/_sdbm.c:229:18:        flags |= O_CLOEXEC;
ext/pty/pty.c:257:38:    /* FreeBSD 9.2 or later supports O_CLOEXEC
ext/pty/pty.c:266:14:# if defined(O_CLOEXEC)
ext/pty/pty.c:268:51:    * So version dependency on GNU/Linux is same as O_CLOEXEC with open().
ext/pty/pty.c:269:5:     * O_CLOEXEC is available since Linux 2.6.23.  Linux 2.6.18 silently ignore it. */
ext/pty/pty.c:270:11:   flags |= O_CLOEXEC;
dir.c:1439:41:    const int opendir_flags = (O_RDONLY|O_CLOEXEC|
io.c:238:13:#if defined(O_CLOEXEC) && defined(F_GETFD)
io.c:246:27:#endif /* fall through if O_CLOEXEC does not work: */
io.c:257:8:#ifdef O_CLOEXEC
io.c:258:8:    /* O_CLOEXEC is available since Linux 2.6.23.  Linux 2.6.18 silently ignore it. */
io.c:259:14:    flags |= O_CLOEXEC;
io.c:295:35:#if defined(HAVE_DUP3) && defined(O_CLOEXEC)
io.c:298:38:            ret = dup3(oldfd, newfd, O_CLOEXEC);
io.c:327:29:        ret = pipe2(fildes, O_CLOEXEC);

should we add ifdef in dir.c for building on some platform without O_CLOEXEC

Associated revisions

Revision 45765e94
Added by normal over 1 year ago

dir.c: define O_CLOEXEC for older systems

SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 63720
Added by normalperson (Eric Wong) over 1 year ago

dir.c: define O_CLOEXEC for older systems

SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

Revision 63720
Added by normal over 1 year ago

dir.c: define O_CLOEXEC for older systems

SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

Revision b5d43b1d
Added by nagachika (Tomoyuki Chikanaga) 10 months ago

merge revision(s) 63720: [Backport #14864]

    dir.c: define O_CLOEXEC for older systems

    SuSE 10 has openat(), but not O_CLOEXEC

    Reported-by: wangpeiwen

    [ruby-core:87591] [Bug #14864]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 66878
Added by nagachika (Tomoyuki Chikanaga) 10 months ago

merge revision(s) 63720: [Backport #14864]

dir.c: define O_CLOEXEC for older systems

SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

History

#1

Updated by normalperson (Eric Wong) over 1 year ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: REQUIRED
#2

Updated by normalperson (Eric Wong) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r63720.


dir.c: define O_CLOEXEC for older systems

SuSE 10 has openat(), but not O_CLOEXEC

Reported-by: wangpeiwen

[ruby-core:87591] [Bug #14864]

Updated by nagachika (Tomoyuki Chikanaga) 10 months ago

  • Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: REQUIRED to 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: DONE

ruby_2_5 r66878 merged revision(s) 63720.

Also available in: Atom PDF