5e35364838
Change-Id: I9fcbf955d8b7b01ff1025534a8c2eaa8e6790565 Signed-off-by: Srinivasan Subramanian <srinivasan.subramanian@amd.com>
26 行
565 B
C
26 行
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;
|
|
}
|