[LTP] [PATCH V2 1/2] syscalls: Add tests for name_to_handle_at()

Viresh Kumar viresh.kumar@linaro.org
Tue Nov 24 06:03:53 CET 2020


On 23-11-20, 15:06, Cyril Hrubis wrote:
> Hi!
> > diff --git a/include/lapi/name_to_handle_at.h b/include/lapi/name_to_handle_at.h
> > new file mode 100644
> > index 000000000000..19c08545802a
> > --- /dev/null
> > +++ b/include/lapi/name_to_handle_at.h
> > @@ -0,0 +1,54 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * Copyright (c) 2020 Linaro Limited. All rights reserved.
> > + * Author: Viresh Kumar <viresh.kumar@linaro.org>
> > + */
> > +
> > +#ifndef NAME_TO_HANDLE_AT_H__
> > +#define NAME_TO_HANDLE_AT_H__
> > +
> > +#include <sys/syscall.h>
> > +#include "config.h"
> > +#include "tst_buffers.h"
> > +#include "tst_test.h"
> > +
> > +#ifndef HAVE_NAME_TO_HANDLE_AT
> > +struct file_handle {
> > +	unsigned int handle_bytes;
> > +	int handle_type;
> > +	/* File identifier.  */
> > +	unsigned char f_handle[0];
> > +};
> > +
> > +int name_to_handle_at(int dfd, const char *pathname, struct file_handle *handle,
> > +		      int *mount_id, int flags);
> > +int open_by_handle_at(int mount_fd, struct file_handle *handle, int flags);
> 
> This still is not complete solution. As far as I can tell this will fail
> to link on machine where libc does not implement these, so we have to
> make them static inline functions that actually call the tst_syscall().

This is embarrassing. Not that I was doing this for the first time, I
just completely forgot to update this path, damn. Sorry about that.

-- 
viresh


More information about the ltp mailing list