how to differentiate system call from library call

Hi,
Ho do I differentiate system call from library call?
for example if I am using chmod , how do I find out if it is a system call or library call?

Thanks
Muru

Check the man page. For chmod it will be something like chmod(2). Your OS will have specific sections of the man pages dedicated to things like system calls, user commands, admin commands, files and so on. The (2) usually means system call on most systems. Now check the man page for something else like fprintf. You will see either fprintf(3C) or fprintf(3). On most systems, section 3/3C is for library functions.

Look in "/usr/include/sys/syscall.h" or equivalent for a macro identifying an index for that call

You may not be able to as you link with libc.a (or similar) and that provides the calls, these may be a full implementation or a wrapper around the actual system call.