# flock() php_flock() compile problems

- Thread: https://externals.io/message/28698
- Original archive: https://news-web.php.net/php.internals/28698
- Started by Frank M. Kromann on 2007-04-06T04:39:49+00:00
- Messages: 2
- 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

---

## #28698 — Frank M. Kromann — 2007-04-06T04:39:49+00:00

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

Hi Rasmus,

But the definition of flock in win32/flock.c() is identical to the
definition of php_flock() in ext/standard/flock_compat.c.

I don't see any reason to hae the same function defined twice with two
different names.

- Frank

> Frank M. Kromann wrote:
> > […]
ext\standard\config.w32
> > […]
> 
> Rob tracked it down to the fact that it was using stdio.  I hadn't
> realized that.  So, the fix is to use VCWD_OPEN_MODE instead of FOPEN
> and a write() instead of the fprintf.
> 
> -Rasmus

---

## #28699 — Rasmus Lerdorf — 2007-04-06T04:42:06+00:00

URL: https://externals.io/message/28698#28699 · In reply to: #28698

Sure, but the lock isn't needed at all here, so while your fix is
probably correct for other cases that actually need a lock call, this
isn't one of them.

-Rasmus

Frank M. Kromann wrote:
> Hi Rasmus,
> 
> But the definition of flock in win32/flock.c() is identical to the
> definition of php_flock() in ext/standard/flock_compat.c.
> 
> I don't see any reason to hae the same function defined twice with two
> different names.
> 
> - Frank
> 
> > […]
> ext\standard\config.w32
> > […]
