Which system calls do these functions make?
Which win32 api calls do these functions use (if any)?
_开发者_JS百科itoa_s(), strcat_s()
Possibly NONE.
These functions are the MicroSoft secure versions of the C standard itoa
and strcat
. These C functions are part of the C library, not the system library. The feature they provide can be implemented entirely without any need of system calls.
But in the end, I have absolutely no idea if they make system calls or not.
Only one, really, SetUnhandledExceptionFilter(). Followed by TerminateProcess(). Which is in the code path when the function has detected a buffer overflow. This prevents malware from getting activated by hooking the unhandled exception filter and intentionally causing an access violation. Unfortunately also making it quite difficult to do custom crash reporting when the overflow is triggered by a simple programming bug. Code is in vc/crt/gs_report.c
You can just step into them using the debugger and see exactly what they do. At first glance, they don't do any system calls, which is what I would expect.
I would be very concerned, from a performance point of view, if such 'basic' facilities required a system call. I don't have a definitive answer to your question, but common sense would say : none.
精彩评论