History log of /php-src/ext/posix/posix.c (Results 1 – 25 of 219)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 32efc76c 16-Apr-2024 Arnaud Le Blanc

Use return value of getpwuid_r(), not errno (#13969)


# 26c432d8 13-Apr-2024 David CARLIER

ext/posix: changing helpers return to zend_result. (#13957)


# 66809c05 11-Apr-2024 Arnaud Le Blanc

Fix usage of reentrant functions in ext/posix (#13921)

- It's not necessarily an error of sysconf(_SC_GETPW_R_SIZE_MAX) returns -1, as
specified by posix (and the musl implementation a

Fix usage of reentrant functions in ext/posix (#13921)

- It's not necessarily an error of sysconf(_SC_GETPW_R_SIZE_MAX) returns -1, as
specified by posix (and the musl implementation always returns -1). Pick an
initial buffer size in this case.
- Reentrant variants return an error number an may not set errno
- Implement retry logic for ttyname_r()
- Fix retry logic for getpwnam_r() (pw would be NULL after the first try)
- Test retry logic by setting the initial buffer size to 1 in debug builds

show more ...


# db286934 08-Apr-2024 David Carlier

ext/posix: posix_isatty set errno for it too.

Close GH-13918


# c6f4c26e 15-Mar-2024 Peter Kokot

Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706)

The non-standard major(), minor(), and makedev() can be defined as
macros. These are usually used together with th

Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706)

The non-standard major(), minor(), and makedev() can be defined as
macros. These are usually used together with the Autoconf macro
AC_HEADER_MAJOR, which defines the MAJOR_IN_MKDEV if sys/mkdev.h is
available, or MAJOR_IN_SYSMACROS if sys/sysmacros.h is available.

On Solaris/illumos they are in the sys/mkdev.h header (macro defined to
libc implementation) and in sys/sysmacros.h (macro defined with binary
operators and bits shifting). On systems with musl and glibc 2.28 or
later they are defined in sys/sysmacros.h, in glibc 2.27 and earlier
they were in sys/types.h. On BSD-based systems and macOS they are in the
sys/types.h.

Autoconf 2.70 has fixed the AC_HEADER_MAJOR macro, so it detects the
headers properly due to glibc 2.25 throwing deprecation warnings when
using the macros from sys/types.h. With Autoconf 2.69 and earlier the
ac_cv_header_sys_types_h_makedev cache variable can skip the
improper sys/types.h check in the macro.

This change syncs the usage within the ext/fileinfo/libmagic bundled
library and ext/posix.

When sys/mkdev.h header is available, code includes that, otherwise
it conditionally includes the sys/sysmacros.h. The ext/posix has
additional check whether linker sees the makedev, otherwise it checks
if makedev is declared within the given set of headers accoring to the
AC_HEADER_MAJOR logic. Previously the AC_CHECK_FUNCS didn't detect it.

show more ...


# f9cfd40f 06-Feb-2024 Peter Kokot

Refactor utsname.domainname struct member Autoconf check (#13336)

* Refactor utsname.domainname struct member Autoconf check

Autoconf's AC_CHECK_MEMBERS macro (available since Autoc

Refactor utsname.domainname struct member Autoconf check (#13336)

* Refactor utsname.domainname struct member Autoconf check

Autoconf's AC_CHECK_MEMBERS macro (available since Autoconf 2.50) can be
used instead of the compile check. This was originally implemented for
IRIX compatibility, when Autoconf 2.13 didn't have the struct members
checking macro yet.

Macro by default here defines the HAVE_STRUCT_UTSNAME_DOMAINNAME symbol.

* Remove also redundant DARWIN symbol check

Checking in the configuration step also correctly detects missing struct
member on Darwin systems (macos...).

show more ...


# ff2b5088 19-Nov-2023 Peter Kokot

Refactor checks for fpathconf and pathconf

These two might not be available everywhere so we check them in
config.m4 when doing the configure step. Check is skipped for musl libc
due

Refactor checks for fpathconf and pathconf

These two might not be available everywhere so we check them in
config.m4 when doing the configure step. Check is skipped for musl libc
due to limited implementation.

Constants that are defined into main/php_config.h:
HAVE_FPATHCONF
HAVE_PATHCONF

Implemented via GH-10238
Related to GH-10350
Fixes GH-12725

show more ...


# 66e2aa72 13-Jul-2023 Ilija Tovilo

Fix use-of-uninitialized-value when calling php_posix_stream_get_fd (#11694)

Passing a double pointer to php_stream_cast means the caller of
php_posix_stream_get_fd will never receive th

Fix use-of-uninitialized-value when calling php_posix_stream_get_fd (#11694)

Passing a double pointer to php_stream_cast means the caller of
php_posix_stream_get_fd will never receive the actual value. Moreover,
php_posix_stream_get_fd may only write the low sizeof(php_socket_t) bytes of fd,
so we need to initialize the upper bytes to 0 to avoid partial
use-of-uninitialized-value.

show more ...


# 59f6d08f 11-Jul-2023 George Peter Banyard

ext/posix: posix_isatty() fix use-of-uninitialized-value (#11676)

When the value passed is not representable as an int then it is not a TTY and thus should return false immediately.

ext/posix: posix_isatty() fix use-of-uninitialized-value (#11676)

When the value passed is not representable as an int then it is not a TTY and thus should return false immediately.

This was reported by MSAN.

show more ...


# 39ef5ca3 10-Jul-2023 George Peter Banyard

Add tests for uncastable streams and dataloss streams (#10173)

And suppress the nonsensical warnings by passing the PHP_STREAM_CAST_INTERNAL flag.


# 717f460f 29-Mar-2023 David CARLIER

ext/posix: posix_eaccess little update and forgotten UPGRADING entry. (#10965)


# 2b354318 23-Mar-2023 David CARLIER

ext/posix: proposing posix_eaccess. unlike access, it is not standard but available in enough platforms ; on linux it's euidaccess in reality eaccess being 'just' an alias. key difference is eaccess

ext/posix: proposing posix_eaccess. unlike access, it is not standard but available in enough platforms ; on linux it's euidaccess in reality eaccess being 'just' an alias. key difference is eaccess checks the effective user id instead.

Close GH-10917

show more ...


# ab3f8718 13-Feb-2023 Cristian Rodríguez

posix: fix misuse of bool (invalid code in c23)

a bool pointer argument cannot take true or false but either &boolval
or NULL

Closes GH-10577.


# dee39518 16-Jan-2023 David Carlier

posix detects posix_pathconf api.

alpine linux throws undefined reference at build time, thus
not assuming it s necessarily available.

Closes GH-10350.


# 7936c808 23-Jan-2023 Máté Kocsis

Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385)


# 55d19eee 07-Jan-2023 David Carlier

posix adding posix_fpathconf.

follow-up on GH-10238 but with the file descriptor flavor.

Close GH-10253


# 61cf7d49 07-Jan-2023 David Carlier

posix_pathconf throwing ValueError on empty path


# 84af629e 06-Jan-2023 David CARLIER

follow-up on GH-10238. (#10243)

fixes based on feedback.


# 69d49e4d 05-Jan-2023 David Carlier

posix adding posix_pathconf.

to get configuration variables from a directory/file.
Closes GH-10238.


# 31e7d6ef 30-Dec-2022 George Peter Banyard

Check that int file descriptor is valid for posix_(isatty|ttyname)


# 54767b10 28-Dec-2022 George Peter Banyard

Manually handle int ZPP for posix_isatty()/posix_ttyname()


# c2b0be55 30-Dec-2022 George Peter Banyard

Fix memory leak in posix_ttyname()

Closes GH-10190


# d10a04b3 20-Oct-2022 Ilija Tovilo

Allow specifying resource in posix_getrlimit() for single result

Closes GH-9790


# a5a8b5ff 04-Sep-2022 David Carlier

posix add sysconf call.

providing handful of common and most used constants.

Closes GH-9481.


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22
# 17f3631d 22-Jul-2022 Máté Kocsis

Declare ext/posix constants in stubs (#9095)

123456789