// example: $stream = fopen(FILE, 'rb') or die('???');
$md = stream_get_meta_data($stream);
echo $md['wrapper_type'];
flock($stream);
if this prints
plainfile then the call to the php function flock() is handled by php_stdiop_set_option(...) which calls flock(). Depending on whether PHP was compiled with HAVE_FLOCK or not this may be the system call
flock() or a function defined in flock_compat.c which utilizes
fcntl(). On my gentoo system PHP was compiled with HAVE_FLOCK.
Ana / akarsu / plain_wrapper.c @ static int php_stdiop_set_option (...):
case PHP_STREAM_OPTION_LOCKING:
if (fd == -1) {
return -1;
}
if ((zend_uintptr_t) ptrparam == PHP_STREAM_LOCK_SUPPORTED) {
return 0;
}
if (!flock(fd, value)) {
data->lock_flag = value;
return 0;
} else {
return -1;
}
break;