/* This can store 16 bytes of OS-Dependent data. We use a byte-by-byte write approach. It's up to userspace to deal with it when constructing its input buffer.  */
static ssize_t pdcs_osdep1_write(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
/* This can store 16 bytes of OS-Dependent data. We use a byte-by-byte write approach. It's up to userspace to deal with it when constructing its input buffer.  */
static ssize_t pdcs_osdep1_write(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
	u8 in[16];
	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;
	if (!buf || !count)
		return -EINVAL;
	if (unlikely(pdcs_osid != OS_ID_LINUX))
		return -EPERM;
	if (count > 16)
		return -EMSGSIZE;
	memset(in, 0, 16);
	memcpy(in, buf, count);
	if (pdc_stable_write(PDCS_ADDR_OSD1, &in, sizeof(in)) != PDC_OK)
		return -EIO;
	return count;
}