Is there a system call function whose definition calls another system call function?

  • A+
Category:Languages

In Linux, is there a system call function whose definition calls another system call function?

Or are all the system call functions exclusive to each other in the sense that any system call function doesn't call another system call function?

Or are the system call functions mostly exlusive to each other in the above sense?

Thanks.


Well, for each system call, only ONE trap is generated, but some calls share codes, for instance, sys_epoll_create(), once in kernel mode, calls sys_epoll_create1() (see eventpoll.c for kernell 2.6.35):

SYSCALL_DEFINE1(epoll_create, int, size) {     if (size <= 0)         return -EINVAL;      return sys_epoll_create1(0); } 

In more recent kernelk (4.17-rc2), the same functions share code:

SYSCALL_DEFINE1(epoll_create1, int, flags) {     return do_epoll_create(flags); }  SYSCALL_DEFINE1(epoll_create, int, size) {     if (size <= 0)         return -EINVAL;      return do_epoll_create(0); } 

So the answer to your question is yes, but it depends of kernel version...

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: