Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yoon__HanJae
Beginner
99 Views

Why does SGX calling ioctl so many times?

Hello,

When I analysis sgx process by using strace, ioctl function is called so many times after mmap function like below.

1424  11:18:56 mmap(NULL, 4194304, PROT_NONE, MAP_SHARED, 4, 0) = 0x7f7e6a800000
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x00, 0x08), 0x7ffdadb760b0) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0
1424  11:18:56 ioctl(4, _IOC(_IOC_WRITE, 0xa4, 0x01, 0x1a), 0x7ffdadb76f00) = 0

Is there anyone who knows why this function is called so many times?
What means this function?

0 Kudos
1 Reply
JesusG_Intel
Moderator
99 Views

Hello HanJae,

ioctl are system calls in the OS used to access kernel-level device drivers from the user space application. For example, you may find it after an attempt to open /dev/isgx or after memmap or munmap function calls. This wiki page has a good discussion on ioctl, https://en.wikipedia.org/wiki/Ioctl, also see https://linux.die.net/man/2/ioctl.

Regards,
Jesus

Reply