LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-18-2007, 10:03 PM   #1
gtopmiller
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Rep: Reputation: 0
sysfs bin file lseek problem


I'm using version 2.6.16.27 release of the kernel and have implemented the w1 driver for the ds2433. In the ds2433_w1 module it creates a sysfs bin file using sysfs_create_bin_file function. This creates a file called /sys/bus/w1/devices/23-00000073aae7/eeprom which I can open, read, and write. I can not lseek. I get an error with errno = 29, which is defined as ESPIPE. The lseek man page indicates "ESPIPE Fildes is associated with a pipe, socket, or FIFO". The ds2433 is not one of these and I don't see any way to add an lseek callback to the sysfs_create_bin_file. I assumed it was inherently part of it. The bin_attribute of the sysfs bin file has read and write callbacks which have an offset as an argument so it should be a simple implementation for lseek. Is there some attribute that needs to be added to have sysfs bin files support lseek?

Thanks for any advice.
 
Old 04-10-2007, 04:35 PM   #2
gtopmiller
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Original Poster
Rep: Reputation: 0
This was not really a problem. I was checking for the return value of lseek to be equal to zero and returning an error if it wasn't. lseek will usually return a non-zero value since it is returning the position in the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LM Sensors Help, Can't access procfs/sysfs file Unable to find i2c bus information; Whiskers Linux - Software 16 11-03-2008 04:58 PM
lm_sensors Can't access procfs/sysfs file humbletech99 Linux - Hardware 0 08-31-2006 06:40 AM
problem with lseek crash88 Programming 2 07-08-2006 07:54 PM
.bin file problem loda117 Linux - Software 6 05-29-2006 02:51 AM
libbridge_private.h:36:28: sysfs/libsysfs.h: No such file or directory cellist Linux - Software 1 12-07-2004 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration