Skip to content

Use utils_getpid() and utils_gettid() in util_log_internal() #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ldorau
Copy link
Contributor

@ldorau ldorau commented May 23, 2024

Description

Use syscall(SYS_gettid) instead of gettid(),
because gettid() can be undefined in older OSes.

gettid() is undefined in CI OSes of OpenMP.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@ldorau ldorau requested a review from a team as a code owner May 23, 2024 09:37
Copy link
Contributor

@lplewa lplewa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito: you could remove gnusource define from file, and remove

@bratpiorka
Copy link
Contributor

@vinser52 please rebase

@vinser52
Copy link
Contributor

@vinser52 please rebase

@ldorau, I think it is a request to you.

@ldorau
Copy link
Contributor Author

ldorau commented May 27, 2024

dito: you could remove gnusource define from file, and remove

@lplewa strerror_r() also requires _GNU_SOURCE to be defined:

/home/ldorau/work/unified-memory-framework/src/utils/utils_log.c: In function ‘util_log_internal’:
/home/ldorau/work/unified-memory-framework/src/utils/utils_log.c:128:25: error: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
  128 |             char *err = strerror_r(saveno, err_buff, sizeof(err_buff));
      |                         ^~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Lukasz Dorau <[email protected]>
@ldorau ldorau force-pushed the Use_syscallSYS_gettid_instead_of_gettid branch from a5cd6b3 to f6443e5 Compare May 27, 2024 12:44
@ldorau
Copy link
Contributor Author

ldorau commented May 27, 2024

@vinser52 please rebase

@ldorau, I think it is a request to you.

@vinser52 I think so ;-)
@bratpiorka Done.

@ldorau ldorau changed the title Use syscall(SYS_gettid) instead of gettid() Use utils_getpid() and utils_gettid() in util_log_internal() May 27, 2024
@ldorau ldorau requested review from vinser52 and bratpiorka May 27, 2024 12:47
@ldorau ldorau force-pushed the Use_syscallSYS_gettid_instead_of_gettid branch from f6443e5 to 13b3b03 Compare May 27, 2024 13:01
@ldorau
Copy link
Contributor Author

ldorau commented May 28, 2024

@bratpiorka @vinser52 Re-review please.

@bratpiorka bratpiorka requested review from vinser52 and removed request for vinser52 May 31, 2024 10:10
@ldorau ldorau merged commit d671882 into oneapi-src:main Jun 3, 2024
69 checks passed
@ldorau ldorau deleted the Use_syscallSYS_gettid_instead_of_gettid branch June 3, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants