How do I call the lstat system call in linux/c, not the lstat wrapper around it (lstat(3))? There is no SYS_lstat for syscall(SYS_lstat…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using the syscall directly, you need to make sure your definition of
struct statand the kernel’s definition agree. Also if you’re on a 32-bit machine you should probably never use the deprecatedlstatsyscall but instead thelstat64one, since the former will fail on large files. These and numerous other issues are why it’s a bad idea to make syscalls yourself instead of using the standard library; the latter wraps around all the legacy compatibility cruft and gives you a standards-compliant POSIX interface.