libsmbclient smbc_lseek works wrong?

Jelmer Vernooij jelmer at samba.org
Wed Jan 12 13:53:26 GMT 2005


On Wed, Jan 12, 2005 at 07:18:36PM +0600, RandoMan wrote about 'libsmbclient smbc_lseek works wrong?':
> As far as I understand, the call of smbc_lseek() should set the
> current position of file and return the resulting position in the
> file. I trying to use following code:

> int sfd=smbc_open(filename,O_RDONLY,0644);
> off_t cur_pos=smbc_lseek(sfd,start,SEEK_SET);

> and cur_pos sets to zero.
> The file I tried to open exists, and has length 43 bytes, the
> following smbc_read lists the content of this file, but smbc_lseek
> doesn't  set the position to read.
> What I do wrong? :-/

Make sure you compile your application with the same flags as 
Samba was compiled. off_t is different in size when compiled with 64
bit support enabled.

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://jelmer.vernstok.nl/
 14:51:49 up 4 days, 18:06,  5 users,  load average: 1.22, 1.17, 0.96
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20050112/dc0c1e1a/attachment.bin


More information about the samba-technical mailing list