Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6333

Passing int to sysfs

$
0
0

I want to pass int to sysfs_store

What I tried

userspace

int tid = 5234; // can be negative as wellchar buf[5];sprintf(buf, "%d\n", tid);write (fd, buf, 1);

driver sysfs_store

int v;kstrtoint(buf,10,&v);pr_info("%d\n",v); // printing only first digit 5. Should print 5234

Viewing all articles
Browse latest Browse all 6333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>