# FD_CLOEXEC issue

- Thread: https://externals.io/message/13127
- Original archive: https://news-web.php.net/php.internals/13127
- Started by Kamesh Jayachandran on 2004-10-04T08:19:40+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #13127 — Kamesh Jayachandran — 2004-10-04T08:19:40+00:00

URL: https://externals.io/message/13127#13127

Hi All,
I could see in ps_files_open function of ext/session/mod_files.c having
fcntl call.
Call looks like the following,
fcntl(data->fd, F_SETFD, 1);
And this change has happened on 2 years and 5 months back(version 1.73
of mod_files.c). The comment has the following, 
"Set the close-on-exec flag for fds. Child processes should not inherit
the fd."
If it is the intension the last argument to fcntl should be FD_CLOEXEC
right.
I agree that FD_CLOEXEC translates to 1 in Linux. But what about other
systems like NetWare where it translates to 32768.

Can I modify it to FD_CLOEXEC in stead of 1.

With regards
Kamesh Jayachandran

---

## #13128 — Sascha Schumann — 2004-10-04T08:39:02+00:00

URL: https://externals.io/message/13127#13128 · In reply to: #13127

> Can I modify it to FD_CLOEXEC in stead of 1.

     Absolutely.

     - Sascha

---

## #13129 — Derick Rethans — 2004-10-04T08:40:51+00:00

URL: https://externals.io/message/13127#13129 · In reply to: #13127

> Can I modify it to FD_CLOEXEC in stead of 1.

Looks okay to me.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
