Difference between SYS_getdents and SYS_getdents64
Hi, I am trying to make some modifications to some source code for a program which makes a call to getdents system call via the syscall function. The code only supports a call via using the constant SYS_getdents which doesn't seem to be present on a version of armbian I am using. I did a grep for this under ubuntu and it seems that the exact value is defined differently in different header files(__NR_getdents). What is the correct way to include support for 64 and 32 bit platforms? I would like to have the code so it correctly compiles on both armbian 64 bit and regular x86 variants of linux
Thanks in advance, |
You just need to find what arch you are using, from cli
Code:
uname -m |
Thanks for the reply. I guess a followup question would be how does one determine which define to use in cases when they are both defined? For example the x86 headers seem to have them defined to different constants and thus different functions in the kernel syscall table. I am actually a bit confused by why arm has only one of these defined yet on 64 bit x86 they are both defined?
Thanks. |
The first place to start is the system manpages.
You then need to decide whether you need the extra info that the getdents64 call supplies, but see this in the manpage: 'These are not the interfaces you are interested in. Look at readdir(3) for the POSIX-conforming C library interface. This page documents the bare kernel system call interfaces.' |
Is there some reason then that armbian (64 bit) lacks the SYS_getdents define but has the SYS_getdents64 variant?
|
Quote:
|
All times are GMT -5. The time now is 03:36 PM. |