Skip to content
Snippets Groups Projects
Commit d810c70e authored by André Almeida's avatar André Almeida
Browse files

futex2: Add sysfs entry for syscall numbers


In the course of futex2 development, it will be rebased on top of
different kernel releases, and the syscall number can change in this
process. Expose futex2 syscall number via sysfs so tools that are
experimenting with futex2 (like Proton/Wine) can test it and set the
syscall number at runtime, rather than setting it at compilation time.

Signed-off-by: default avatarAndré Almeida <andrealmeid@collabora.com>
parent b88c926a
No related branches found
No related tags found
No related merge requests found
......@@ -115,3 +115,27 @@ SYSCALL_DEFINE4(futex_waitv, struct futex_waitv __user *, waiters,
kfree(futexv);
return ret;
}
static ssize_t waitv_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf)
{
return sprintf(buf, "%u\n", __NR_futex_waitv);
}
static struct kobj_attribute futex2_waitv_attr = __ATTR_RO(waitv);
static struct attribute *futex2_sysfs_attrs[] = {
&futex2_waitv_attr.attr,
NULL,
};
static const struct attribute_group futex2_sysfs_attr_group = {
.attrs = futex2_sysfs_attrs,
.name = "futex2",
};
static int __init futex2_sysfs_init(void)
{
return sysfs_create_group(kernel_kobj, &futex2_sysfs_attr_group);
}
subsys_initcall(futex2_sysfs_init);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment