Arquivos
rocm-systems/libhsakmt/src/libhsakmt.c
T
Chris Freehill 11fd5c2562 Prepare for integration into rocr
Change-Id: I6102b9910dbb9d09e09bb262a03c5c0ad4ce66f4
2024-04-30 09:01:09 -05:00

26 linhas
565 B
C

#include <stdio.h>
#include <errno.h>
#include <sys/ioctl.h>
#include "libhsakmt.h"
/* Call ioctl, restarting if it is interrupted */
int kmtIoctl(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");
is_forked_child();
}
return ret;
}