General question about sys_ functions

Jeremy Allison jra at samba.org
Tue Dec 18 18:39:02 GMT 2001


On Tue, Dec 18, 2001 at 10:34:59PM +0100, andreas moroder wrote:
> Hello,
> 
> few days ago in "bug in vfs-wrap.c ?" I asked if the use of readdir() was OK.
> 
> Now, because I got no answer an there are no changes in the 2.2 CVS , I will 
> ask in a more general way.
> 
> 1. Is it ok to use functions like fstat if there are sys_ functions ( 
> sys_fstat in this case ) that call the underlying libc function?
> 
> This happens in tdb.c

tdb uses these as it is a standalone module.

> 2. Is it ok to use sys_ functions if there are vfs functions of this type ?

The sys_ functions are usually there to hide specific system problems or
configurations (ie. 32 bit vs 64 bit underlying systems) in cases when
the calling code wants to treat them identicalls.

tdb doesn't ever need to use 64 bit files, or care about some of the
other problems the sys_XXX calls fix, so it uses them directly.

vfs modules should use sys_XX functions where they exist, as they
do care about the semantics being the same on all platforms (as does
all the core smbd file serving code).

Jeremy.




More information about the samba-technical mailing list