The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reading a file from a specified offset saurabhsinha23 UNIX for Dummies Questions & Answers 2 12-13-2007 12:52 PM
negative permissions sickoboy UNIX for Dummies Questions & Answers 4 10-12-2006 09:49 PM
offset - informix chunk shibz UNIX for Dummies Questions & Answers 1 01-27-2003 11:44 AM
Accessing substrings by offset and length Vishnu High Level Programming 2 10-17-2002 10:07 AM
negative UID/GID?!! I can see 'em but what the hell do they mean?! hellz UNIX for Dummies Questions & Answers 2 09-07-2001 03:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-09-2008
DNAx86 DNAx86 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 69
Negative Offset

Function: int fcntl(int fd, int cmd, struct flock * lock)

Data Type: struct flock
This structure is used with the fcntl function to describe a file lock. It has these members:

off_t l_start
This specifies the offset of the start of the region to which the lock applies, and is given in bytes relative to the point specified by l_whence member.

off_t l_len
This specifies the length of the region to be locked. A value of 0 is treated specially; it means the region extends to the end of the file.


Can I set negative offset to l_start?
  #2 (permalink)  
Old 05-09-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,720
off_t is a typedef for long (C99 standard) so, yes it can be negative if the l_whence is SEEK_CUR or SEEK_END
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0