Implementing SMB_VFS_FCNTL in Samba
Anoop C S
anoopcs at cryptolab.net
Wed Sep 25 18:39:34 UTC 2019
On Mon, 2019-09-23 at 08:31 -0700, Jeremy Allison via samba-technical
> On Mon, Sep 23, 2019 at 02:51:24PM +0530, Anoop C S wrote:
> > Hi all,
> > I am attaching a patch as an attempt to implement SMB_VFS_FCNTL(for
> > a
> > background see https://bugzilla.samba.org/show_bug.cgi?id=14060).
> > But I
> > have the following question.
> > int fcntl(int fd, int cmd, ... /* arg */ );
> > As per man page, fcntl(2) system call can accept a third optional
> > argument. If present it can be of type int, struct flock *, struct
> > f_owner_ex * or uint64_t *. Our current SMB_VFS_LOCK and
> > SMB_VFS_GETLOCK takes care of "Advisory record locking" and "Open
> > file
> > description locks" commands which requires third argument of type
> > struct flock *. Other important fact here to notice is that in most
> > cases the required third argument type is int. The patch I have
> > prepared right now assumes third argument type to be int.
> > So should we rename the call to something else(keeping third
> > argument
> > as int) or change the implementation to consider optional third
> > argument as variable?
> I think we need a varargs argument here like the real fcntl
Please find the attached patch in the above suggested direction. For
now it is compile tested only. I will respond back afterwards with some
basic testing results.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11056 bytes
Desc: not available
More information about the samba-technical