[Beds] C Programming Question

Mark beds.lug at mark-neale.net
Thu Feb 16 18:45:53 GMT 2006


On Thu, 2006-02-16 at 17:12 +0000, Stephen Elliott wrote:
> Hi,
> 
> Please could someone tell me what the following line does.
> 
> seekp = lseek(fd, 0, SEEK_CUR);
> 
> My belief is it won't move the file pointer as the offset is set to 0.
> Although it does seem to.

I'm not sure it really does anything, it just tells you where the file
pointer *currently* is.

Both processes share the fd and the write is blocking, so whoever gets
there first will do the first write and the second process will block
until it's finished and then do their write.

The file pointer will move because both processes are writing to the
file. If you need to know where the file pointer is, this is how to do
it.




More information about the Beds mailing list