9d797771b5
To support fully-static library ROCm builds, ensure that all global
symbols are prefixed with something meaningful to avoid collisions with
other libraries
A script was made using" objdump -C -t" to get a list of symbols,
then checking if the global symbols have a meaningful prefix (for thunk:
hsakmt or kmt in various cases)
Change-Id: Ifd353f64a3344eb60d1f6c4e041aa20967b38a59
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 3da42a0847]
26 lignes
576 B
C
26 lignes
576 B
C
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <sys/ioctl.h>
|
|
|
|
#include "libhsakmt.h"
|
|
|
|
/* Call ioctl, restarting if it is interrupted */
|
|
int hsakmt_ioctl(int fd, unsigned long request, void *arg)
|
|
{
|
|
int ret;
|
|
|
|
do {
|
|
ret = ioctl(fd, request, arg);
|
|
} while (ret == -1 && (errno == EINTR || errno == EAGAIN));
|
|
|
|
if (ret == -1 && errno == EBADF) {
|
|
/* In case pthread_atfork didn't catch it, this will
|
|
* make any subsequent hsaKmt calls fail in CHECK_KFD_OPEN.
|
|
*/
|
|
pr_err("KFD file descriptor not valid in this process\n");
|
|
hsakmt_is_forked_child();
|
|
}
|
|
|
|
return ret;
|
|
}
|