[PATCH] Powerpc: Add support for openat and fstatat syscalls

Carl Love cel@us.ibm.com
Tue Oct 12 19:13:43 GMT 2021


Will:


> > I changed the fstatat64 to newfstat.  I re-ran the regression tests
> > on
> > a Power 9 system.  The patch does seem to work correctly.  Don't
> > have
> > a
> > 32-bit system to verify on.
> 
> So.. the regression tests passed with both fstatat64 and newfstat ? 
> That suggests there is not a significant difference between the two
> syscalls, or this particular corner is not being tested.   
> 

It seemed weird to me that both work.  I too was a bit puzzled and
concerned by that.  So I did some more digging .... 

I found the following web page that gives the syscall numbers on a
number of platforms

https://marcin.juszkiewicz.com.pl/download/tables/syscalls.html

So as Ulrich said fstatat64 is listed for powerpc (32-bit) but not
supported for powerpc64.  The fstatat64 call maps to system call number
291.

Looking at newfstatat in the table, it is defined on powerpc64 but not
on powerpc (32-bit).  It also maps to system call number 291.

Clicking on newfstatat and fstatat64 in the left column takes us to the
same man page for both system call names.  

The man pages says is:  

"The fstatat() system call is a more general interface for accessing
file information which can still provide exactly the behavior of each
of stat(), lstat(), and fstat()."  

So, it says to me that calling newfstatat for both, as Ulrich said, is
fine.  I do think this is all rather convoluted.  I guess it is one of
those things that evolved over time into something more convoulted and
confusing then it should be.  

So as you said "...there is not a significant difference between the
two syscalls".  

                        Carl 



More information about the Gdb-patches mailing list