VFS Modules & C++ Support

Andrew Bartlett abartlet at samba.org
Fri Jul 13 22:47:42 UTC 2018


On Fri, 2018-07-13 at 18:24 -0400, Kory Draughn via samba-technical
wrote:
> Hi,
> 
> Q.  Can a samba vfs module be implemented using C++?
> Q.  If so, how do I enable C++ support?

You might be able to do it with extern C etc, but I can't see any
evidence that this has been done before.  Others may be able to better
comment however.

I would stick with C and follow the existing patterns myself.

> Also, in the section titled "*Building Your VFS Module*",
> https://wiki.samba.org/index.php/Writing_a_Samba_VFS_Module#Building_Your_VFS_Module,
> I ran into trouble compiling the fake_compression module.
> 
> To fix this, I made the following changes:
> 
> *Old Code from Wiki*
> 
>     NTSTATUS vfs_fake_compression_init(void);
>     NTSTATUS vfs_fake_compression_init(void) {...}
> 
> *New Code*
> 
>     static_decl_vfs;
>     NTSTATUS vfs_fake_compression_init(TALLOC_CTX* ctx) {...}
> 
> Q.  Are both *static_decl_vfs* and *vfs_fake_compression_init* required?

This looks correct for the new code. 

> It may be worth adjusting the wiki so other developers don't fail at
> building the example module.

Please make an account and do that.

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list