• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: fcntl(fd,F_SETSIZE,?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fcntl(fd,F_SETSIZE,?)


  • Subject: Re: fcntl(fd,F_SETSIZE,?)
  • From: James Bucanek <email@hidden>
  • Date: Fri, 12 Oct 2012 00:05:16 -0700

Paul Nelson <mailto:email@hidden> wrote (Thursday, October 11, 2012 7:16 PM -0500):

I was not sure what you want to accomplish with a symlink from your original
post.

That was just coincidence. My earlier questions about symlink, and my question about fcnt(F_SETSIZE) have nothing to do with each other. :/

You seem interested in the inner workings of all this so here goes.

I am indeed, and I really appreciate the time you've taken to explain it.

If you aren't, this stuff is really boring.

I live for boring.

First, you need to get the xnu sources so you can look in the kernel code.

That, right there, is a huge help. I was Googling opensource.apple.com and wasn't finding anything I was looking for.

This is where all fcntl stuff is implemented.

I just downloaded xnu-2050.18.24 and have found the fcntl implementation, which I trust will reveal the secrets I was looking for.

You will need to realize that
each file system handles their implementation (or doesn't) in their own way.

Understood.

Unfortunately, the code is very hard to follow.

That's an understatement. :)

Anyway, I really value the insight into how symlinks work. I'm going to dig into that code because I have other questions (about deleting ACLs and whatnot) that I think are hidden there too.

My question about the F_SETSIZE fcntl() command was really about trying to reclaim the ability to extend (physically allocate) a file *without* filling the file with zeros. I have a couple of performance issues where I want to pre-allocate several large files--so I know that there's ample free space to accomodate them--before they get populated with data. The problem is, the standard ftruncate() function fills the files with zeros, so they get written twice. On slower media this is a huge waste of time (several minutes in some cases).

According to F_SETSIZE's documentation, it will permit the file size to be extended without filling it with zeros. But the details of the command's argument is not documented. I was hoping a peek at the fcntl() source code would reveal that, and now I've got it.

Thanks again,

--
James Bucanek


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: fcntl(fd,F_SETSIZE,?)
      • From: Shantonu Sen <email@hidden>
References: 
 >Re: fcntl(fd,F_SETSIZE,?) (From: Paul Nelson <email@hidden>)

  • Prev by Date: Re: Generic creation of a symblic link
  • Next by Date: Re: Generic creation of a symblic link
  • Previous by thread: Re: fcntl(fd,F_SETSIZE,?)
  • Next by thread: Re: fcntl(fd,F_SETSIZE,?)
  • Index(es):
    • Date
    • Thread