From e381de82d83d990b27e5c1882015564c68ad4446 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 10 Oct 2023 14:37:06 +0200 Subject: [PATCH] API: clarify that set_pid() assumes the PID won't change until load() Refs #624. Signed-off-by: Brice Goglin --- include/hwloc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hwloc.h b/include/hwloc.h index 62d3d1022..94bd9e578 100644 --- a/include/hwloc.h +++ b/include/hwloc.h @@ -2036,6 +2036,10 @@ HWLOC_DECLSPEC int hwloc_free(hwloc_topology_t topology, void *addr, size_t len) * \note -1 is returned and errno is set to \c ENOSYS on platforms that do not * support this feature. * + * \note The PID will not actually be used until hwloc_topology_load(). + * If the corresponding process exits in the meantime, hwloc will ignore the PID. + * If another process reuses the PID, the view of that process will be used. + * * \return 0 on success, -1 on error. */ HWLOC_DECLSPEC int hwloc_topology_set_pid(hwloc_topology_t __hwloc_restrict topology, hwloc_pid_t pid);