PATH:
opt
/
alt
/
tests
/
alt-php81-pecl-eio_3.1.3-3.el8
/
tests
--TEST-- Check for eio fork support using pcntl --SKIPIF-- <?php if (!extension_loaded('pcntl')) { die('SKIP The pcntl extension is not loaded'); } ?> --FILE-- <?php $str = str_repeat('1', 20); $filename = '/tmp/tmp_file' .uniqid(); $filename2 = '/tmp/tmp_file2' .uniqid(); @unlink($filename); @unlink($filename2); touch($filename); touch($filename2); $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { eio_open($filename, EIO_O_RDWR, 0, EIO_PRI_DEFAULT, function($filename, $fd) use ($str) { eio_write($fd, $str, strlen($str), 0, 0, function($fd, $written) use ($str, $filename) { printf("w: %d l: %d f: %d c: %d\n", $written, strlen($str), filesize($filename), substr_count(file_get_contents($filename), '1')); }, $fd); }, $filename); eio_event_loop(); // we are the parent pcntl_wait($status); //Protect against Zombie children } else { // we are the child eio_open($filename2, EIO_O_RDWR, 0, EIO_PRI_DEFAULT, function($filename2, $fd) use ($str) { eio_write($fd, $str, strlen($str), 0, 0, function($fd, $written) use ($str, $filename2) { printf("w: %d l: %d f: %d c: %d\n", $written, strlen($str), filesize($filename2), substr_count(file_get_contents($filename2), '1')); }, $fd); }, $filename2); eio_event_loop(); } @unlink($filename); @unlink($filename2); ?> --EXPECT-- w: 20 l: 20 f: 20 c: 20 w: 20 l: 20 f: 20 c: 20
[-] fork.phpt
[edit]
[-] eio_stat_basic.phpt
[edit]
[-] eio_open_basic.phpt
[edit]
[-] eio_stat_error.phpt
[edit]
[-] eio_fallocate_basic.phpt
[edit]
[-] eio001.phpt
[edit]
[-] bug65293.phpt
[edit]
[-] eio_seek.phpt
[edit]
[-] eio_truncate_basic.phpt
[edit]
[-] eio_rmdir_basic.phpt
[edit]
[-] eio_chmod_basic.phpt
[edit]
[-] eio_readdir.phpt
[edit]
[-] eio_mkdir_basic.phpt
[edit]
[-] eio_utime_basic.phpt
[edit]
[+]
..
[-] eio_grp_add.phpt
[edit]
[-] eio_unlink_basic.phpt
[edit]
[-] eio_write_variation.phpt
[edit]
[-] eio_sync.phpt
[edit]
[-] eio_open_error.phpt
[edit]
[-] eio_chown_variation.phpt
[edit]
[-] eio_read_basic.phpt
[edit]
[-] eio_sendfile_sockets_php8.phpt
[edit]
[-] eio_mknod_basic.phpt
[edit]
[-] eio_sendfile_sockets.phpt
[edit]
[-] eio_link.phpt
[edit]
[-] eio_sendfile_basic.phpt
[edit]
[-] eio_custom_basic.phpt
[edit]
[-] eio_rename_basic.phpt
[edit]
[-] eio_cancel_basic.phpt
[edit]