According to the Linux manual pages 1 and 2, the function syslog has two different function declarations as follows:
int syslog(int type, char *bufp, int len);
void syslog(int priority, const char *format, ...);
However, other than C++, there is no function overloading in C.
How to explain the fact?
One is defined in section 2 (syslog(2)) of the manual pages (*), thus a system call. The other one is from section 3 (syslog(3)) thus a C library function.
So "technically" they are different functions that happen to have the same name (albeit they are related of course, as (3) is using (2)).
(*) See manual page sections.
The first is a system call not a c function, it is wrapped in the function klogctl, the second is a c function.
Calling a system call is much more involved than simply invoking a function, the declaration in the man pages is simply a short cut showing you the system call name and the arguments it expects in a syntax that programmers are familiar with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With