On Wed, 23 Sep 2026 08:02:52 GMT, Matthias Baesken <[email protected]> wrote:

>> src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c line 288:
>> 
>>> 286:     int res = pthread_key_create(&key, NULL);
>>> 287:     if (res != 0) {
>>> 288:         printf("pthread_key_create failed with result %d\n", res);
>> 
>> Why not also include `strerror(res)` in the output?
>
> The manpage says 'return 0 on success and a non-zero error code on failure.'
> https://man7.org/linux/man-pages/man3/pthread_key_create.3.html
> but is it really cross platform always the same error code that strerror 
> expects?
> I would guess so, but I am not sure.

I suppose the error code could change from platform to platform and so could 
the actual error text for the error code, but it should be providing the 
appropriate text for the error code on the platform it is running on. If you 
aren't comfortable with it, you can just stick with what you have.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32999#discussion_r4083651597

Reply via email to