posix_setrlimit.phpt 508 B

1234567891011121314151617181920
  1. --TEST--
  2. posix_setrlimit(): Basic tests
  3. --EXTENSIONS--
  4. posix
  5. --SKIPIF--
  6. <?php
  7. if (!function_exists('posix_setrlimit')) die('skip posix_setrlimit() not found');
  8. // On FreeBSD the second call does not report an error, though the limit isn't changed either.
  9. if (str_contains(PHP_OS, 'FreeBSD')) die('skip different behavior on FreeBSD');
  10. ?>
  11. --FILE--
  12. <?php
  13. var_dump(posix_setrlimit(POSIX_RLIMIT_NOFILE, 128, 128));
  14. var_dump(posix_setrlimit(POSIX_RLIMIT_NOFILE, 129, 128));
  15. ?>
  16. --EXPECT--
  17. bool(true)
  18. bool(false)